From f50fd7a0a9b53ba475d85670a5428876e13dac36 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Thu, 5 Oct 2017 12:37:06 -0400 Subject: [PATCH 4/9] support-interface-promisc.patch Signed-off-by: Dongqi Chen --- network-scripts/ifdown-eth | 5 +++++ network-scripts/ifup-eth | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/network-scripts/ifdown-eth b/network-scripts/ifdown-eth index 5b75162..60f1ba2 100755 --- a/network-scripts/ifdown-eth +++ b/network-scripts/ifdown-eth @@ -180,4 +180,9 @@ if [ -n "$VLAN" ]; then fi fi +# Support PROMISC +if [ "${PROMISC}" = yes ]; then + ip link set dev ${DEVICE} promisc off +fi + exit $retcode diff --git a/network-scripts/ifup-eth b/network-scripts/ifup-eth index 9bcf57f..fdbbf13 100755 --- a/network-scripts/ifup-eth +++ b/network-scripts/ifup-eth @@ -131,6 +131,11 @@ if [ -n "${MTU}" ]; then ip link set dev ${DEVICE} mtu ${MTU} fi +# Support PROMISC +if [ "${PROMISC}" = yes ]; then + ip link set dev ${DEVICE} promisc on +fi + # is the device wireless? If so, configure wireless device specifics is_wireless_device ${DEVICE} && . ./ifup-wireless @@ -150,6 +155,9 @@ if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" ]; then } ethtool_set + # Flush addresses + ip addr flush dev ${DEVICE} + exit 0 fi -- 1.8.3.1