aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-aliases
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup-aliases')
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases11
1 files changed, 10 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index a647044f..9bc815f3 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -139,6 +139,7 @@ function ini_env ()
GATEWAY=$default_GATEWAY
NO_ALIASROUTING=$default_NO_ALIASROUTING
ONPARENT=""
+ ARPCHECK=""
}
function is_default_gateway ()
@@ -256,9 +257,17 @@ function new_interface ()
fi
if [ "$setup_this" = "yes" ] ; then
+ [ "${parent_device}" != "lo" ] && [ "${ARPCHECK}" != "no" ] && \
+ is_available ${parent_device} && \
+ grep -qswi "up" /sys/class/net/${parent_device}/operstate && \
+ if ! /sbin/arping -q -c 2 -w 3 -D -I ${parent_device} ${IPADDR} ; then
+ net_log $"Error, some other host already uses address ${IPADDR}."
+ return 1
+ fi
+
/sbin/ip addr add ${IPADDR}/${PREFIX} brd ${BROADCAST} dev ${parent_device} label ${DEVICE}
- [ "$IPV6INIT" = "yes" ] && /etc/sysconfig/network-scripts/ifup-ipv6 ${DEVICE}
+ [[ "$IPV6INIT" != [nN0]* ]] && /etc/sysconfig/network-scripts/ifup-ipv6 ${DEVICE}
if [ "$NO_ALIASROUTING" != yes ]; then