diff options
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-x | sysconfig/network-scripts/ifdown | 7 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup | 17 |
2 files changed, 17 insertions, 7 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index f93d7958..c807c711 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -37,6 +37,7 @@ if [ -x /sbin/ifdown-pre-local ]; then fi DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"` +REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'` OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-${DEVICETYPE}" if [ -x $OTHERSCRIPT ]; then @@ -82,10 +83,12 @@ if [ "$BOOTPROTO" = bootp -o "$BOOTPROTO" = dhcp ]; then } else expand_config - ip addr del ${IPADDR}/${PREFIX} brd ${BROADCAST:-+} dev ${DEVICE} + ip addr del ${IPADDR}/${PREFIX} brd ${BROADCAST:-+} dev ${REALDEVICE} fi -ip link set ${DEVICE} down +if [ "${REALDEVICE}" = "${DEVICE}" ]; then + ip link set ${DEVICE} down +fi [ "$retcode" = "0" ] && retcode=$? # wait up to 5 seconds for device to actually come down... diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 8e106ebc..e4fcf05f 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -213,17 +213,24 @@ else SCOPE= fi - if ! LC_ALL=C ip addr ls ${DEVICE} | grep -q "${IPADDR}/${PREFIX}" ; then - if ! ip addr add ${IPADDR}/${PREFIX} \ - brd ${BROADCAST:-+} dev ${DEVICE} ${SCOPE} ; then + if ! LC_ALL=C ip addr ls ${REALDEVICE} | grep -q "${IPADDR}/${PREFIX}" ; then + if [ "$ISALIAS" = "yes" ]; then + if ! ip addr add ${IPADDR}/${PREFIX} \ + brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then echo $"Error adding address ${IPADDR} for ${DEVICE}." + fi + else + if ! ip addr add ${IPADDR}/${PREFIX} \ + brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} ; then + echo $"Error adding address ${IPADDR} for ${DEVICE}." + fi fi fi # update ARP cache of neighboring computers - arping -q -A -c 1 -I ${DEVICE} ${IPADDR} + arping -q -A -c 1 -I ${REALDEVICE} ${IPADDR} ( sleep 2; - arping -q -U -c 1 -I ${DEVICE} ${IPADDR} ) > /dev/null 2>&1 < /dev/null & + arping -q -U -c 1 -I ${REALDEVICE} ${IPADDR} ) > /dev/null 2>&1 < /dev/null & # Add a route for the subnet. Replace any existing route. if [ "${ISALIAS}" = no ]; then |