aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsysconfig/network-scripts/ifdown8
-rwxr-xr-xsysconfig/network-scripts/ifup23
2 files changed, 14 insertions, 17 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 4dea40ed..ffe1d80a 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -37,7 +37,7 @@ if [ -x /sbin/ifdown-pre-local ]; then
fi
DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"`
-REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'`
+[ -z "$REALDEVICE" ] && REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'`
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-${DEVICETYPE}"
if [ -x $OTHERSCRIPT ]; then
@@ -87,7 +87,11 @@ else
# may have been changed in the config file since the device was
# brought up. Flush all addresses associated with this
# instance instead.
- ip addr flush dev ${REALDEVICE} label ${DEVICE} 2>/dev/null
+ if [ "${REALDEVICE}" = "${DEVICE}" ]; then
+ ip addr flush dev ${REALDEVICE} 2>/dev/null
+ else
+ ip addr flush dev ${REALDEVICE} label ${DEVICE} 2>/dev/null
+ fi
fi
if [ "${REALDEVICE}" = "${DEVICE}" ]; then
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index db8d3ca5..8b782ed4 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -57,7 +57,7 @@ fi
# figure out more about what we are dealing with
DEVICETYPE=`echo ${DEVICE} | sed "s/[0-9]*$//"`
-REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'`
+[ -z "$REALDEVICE" ] && REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'`
if echo ${DEVICE} | grep -q ':' ; then
ISALIAS=yes
else
@@ -181,7 +181,7 @@ if [ -n "${DYNCONFIG}" ]; then
else
if [ -z "${IPADDR}" ]; then
# enable device without IP, useful for e.g. PPPoE
- ip link set ${DEVICE} up
+ ip link set ${REALDEVICE} up
if [ "${NETWORKING_IPV6}" = "yes" ]; then
/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG}
fi
@@ -191,16 +191,16 @@ else
expand_config
[ -n "${ARP}${PROMISC}${ALLMULTI}" ] && \
- ip link set ${DEVICE} $(toggle_value arp $ARP) \
+ ip link set ${REALDEVICE} $(toggle_value arp $ARP) \
$(toggle_value promisc $PROMISC) \
$(toggle_value allmulti $ALLMULTI)
- if ! ip link set ${DEVICE} up ; then
+ if ! ip link set ${REALDEVICE} up ; then
echo $"Failed to bring up ${DEVICE}."
exit 1
fi
- if ! arping -q -c 2 -w 3 -D -I ${DEVICE} ${IPADDR} ; then
+ if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
echo $"Error, some other host already uses address ${IPADDR}."
exit 1
fi
@@ -212,17 +212,10 @@ else
fi
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
@@ -232,16 +225,16 @@ else
# Add a route for the subnet. Replace any existing route.
if [ "${ISALIAS}" = no ]; then
- ip route replace ${NETWORK}/${PREFIX} dev ${DEVICE}
+ ip route replace ${NETWORK}/${PREFIX} dev ${REALDEVICE}
fi
# Set a default route.
- if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
+ if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then
# set up default gateway
if [ -n "${GATEWAY}" -a "`ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null`" = "NETWORK=${NETWORK}" ]; then
ip route add default via ${GATEWAY}
elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
- ip route add default dev ${DEVICE}
+ ip route add default dev ${REALDEVICE}
fi
fi
fi