aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2004-06-09 04:45:30 +0000
committerBill Nottingham <notting@redhat.com>2004-06-09 04:45:30 +0000
commit2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028 (patch)
tree2db886390fde5003a1535d6e5fc83816b9ad62ac
parentf68092f16f891b6590bea27cac9313387cd8f1a2 (diff)
downloadinitscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.tar
initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.tar.gz
initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.tar.bz2
initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.tar.xz
initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.zip
bonding fixes
-rwxr-xr-xsysconfig/network-scripts/ifup26
1 files changed, 22 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index bbd151bf..637dcda5 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -120,16 +120,20 @@ if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" -a \
ifconfig ${DEVICE} down
echo $"Enslaving ${DEVICE} to ${MASTER}"
- ifenslave ${RFLAG} "${MASTER}" "${DEVICE}"
+ ifenslave ${RFLAG} "${MASTER}" "${DEVICE}" >/dev/null 2>&1
exit 0
fi
-# master device?
+# Bonding initialization. For DHCP, we need to enslave the devices early,
+# so it can actually get an IP.
if [ "${TYPE}" = "Bonding" -o "$DEVICETYPE" = "bond" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
- ifconfig ${DEVICE} up
+ /sbin/ip link set dev ${DEVICE} down
+ /sbin/ip link set dev ${DEVICE} up
for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
- /sbin/ifup ${device##*/}
+ if [ "$BOOTPROTO" = "dhcp" ]; then
+ /sbin/ifup ${device##*/}
+ fi
done
fi
@@ -263,6 +267,20 @@ else
fi
fi
+# Bonding initialization part II - for static, enslave the devices. For
+# DHCP, remove any routes for the slaves.
+if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
+ for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
+ if [ "$BOOTPROTO" = "dhcp" ]; then
+ DEV=$DEVICE
+ eval $(LANG=C fgrep "DEVICE=" $device)
+ ifenslave -d $DEV DEVICE
+ DEVICE=$DEV
+ fi
+ /sbin/ifup ${device##*/}
+ done
+fi
+
# IPv6 initialisation?
if [ "${NETWORKING_IPV6}" = "yes" ]; then
/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG}