diff options
author | Bill Nottingham <notting@redhat.com> | 2004-06-08 19:49:24 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2004-06-08 19:49:24 +0000 |
commit | 576cb4fa70075cb8e863cda7c4c17f155c5abc71 (patch) | |
tree | 2ea3ab9ac7e1c52e9a02feec1430036f34da8d84 | |
parent | ce47fc1cafdcf1529a70c69a0c9728ee4ee70ef0 (diff) | |
download | initscripts-576cb4fa70075cb8e863cda7c4c17f155c5abc71.tar initscripts-576cb4fa70075cb8e863cda7c4c17f155c5abc71.tar.gz initscripts-576cb4fa70075cb8e863cda7c4c17f155c5abc71.tar.bz2 initscripts-576cb4fa70075cb8e863cda7c4c17f155c5abc71.tar.xz initscripts-576cb4fa70075cb8e863cda7c4c17f155c5abc71.zip |
bonding fixes
- don't enslave before setting the address for static case.
- for DHCP, minimize the erorrs (they won't all go away), and make it
more robust
-rwxr-xr-x | sysconfig/network-scripts/ifup | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index e5d0d65f..2cb24bb0 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -203,7 +203,7 @@ if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" -a \ /sbin/ip link set dev ${DEVICE} down echo $"Enslaving ${DEVICE} to ${MASTER}" - ifenslave ${RFLAG} "${MASTER}" "${DEVICE}" + ifenslave ${RFLAG} "${MASTER}" "${DEVICE}" >/dev/null 2>&1 if [ -n "$ETHTOOL_OPTS" ] ; then /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS @@ -212,11 +212,18 @@ if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" -a \ 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" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then /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 + DEV=$DEVICE + eval $(LANG=C fgrep "DEVICE=" $device) + ifenslave -d $DEV $DEVICE >/dev/null 2>&1 + DEVICE=$DEV + /sbin/ifup ${device##*/} + fi done fi @@ -384,6 +391,23 @@ else 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 + #/sbin/ip link set dev ${DEVICE} up + for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do + if [ "$BOOTPROTO" != "dhcp" ]; then + /sbin/ifup ${device##*/} + else + DEV=$DEVICE + eval $(LANG=C fgrep "DEVICE=" $device) + ip link set ${DEVICE} up + ip route flush dev ${DEVICE} + DEVICE=$DEV + fi + done +fi + # Add Zeroconf route. if [ -z "${NOZEROCONF}" -a "${ISALIAS}" = "no" ]; then ip route replace 169.254.0.0/16 dev ${REALDEVICE} |