aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 678ba257..47b6d385 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -215,17 +215,20 @@ else
if [ -n "$SRCADDR" ]; then
SRC="src $SRCADDR"
- sysctl -w "net.ipv4.conf.${REALDEVICE}.arp_filter=1"
else
SRC=
fi
-
+
if ! LC_ALL=C ip addr ls ${REALDEVICE} | grep -q "${IPADDR}/${PREFIX}" ; then
if ! ip addr add ${IPADDR}/${PREFIX} \
brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then
echo $"Error adding address ${IPADDR} for ${DEVICE}."
fi
fi
+
+ if [ -n "$SRCADDR" ]; then
+ sysctl -w "net.ipv4.conf.${REALDEVICE}.arp_filter=1" >/dev/null 2>&1
+ fi
# update ARP cache of neighboring computers
arping -q -A -c 1 -I ${REALDEVICE} ${IPADDR}