diff options
author | Bill Nottingham <notting@redhat.com> | 2004-06-09 04:45:30 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2004-06-09 04:45:30 +0000 |
commit | 2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028 (patch) | |
tree | 2db886390fde5003a1535d6e5fc83816b9ad62ac /sysconfig/network-scripts | |
parent | f68092f16f891b6590bea27cac9313387cd8f1a2 (diff) | |
download | initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.tar initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.tar.gz initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.tar.bz2 initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.tar.xz initscripts-2f46e82d4cf40ab0bb96adb7e3f35c446ffd2028.zip |
bonding fixes
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-x | sysconfig/network-scripts/ifup | 26 |
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} |