diff --git a/scripts/setup-netdev b/scripts/setup-netdev index 7272392..a616b48 100755 --- a/scripts/setup-netdev +++ b/scripts/setup-netdev @@ -44,22 +44,22 @@ for VLAN in $VLANS ; do echo "$VLAN_BOND not available" exit 23 fi + MY_MODE=`cut -d ' ' -f 2 /sys/class/net/$VLAN_BOND/bonding/mode` + if [[ "$MY_MODE" != "$BOND_MODE" ]] ; then + echo $BOND_MODE \ + > /sys/class/net/$VLAN_BOND/bonding/mode + sleep 2 + fi + ip link set $VLAN_BOND up + [[ -n $MTU ]] && ip link set $VLAN_BOND mtu $MTU + #if [[ -n $SPEED ]] ; then + # ethtool -s $SLAVE_0 autoneg off speed $SPEED duplex full + # ethtool -s $SLAVE_1 autoneg off speed $SPEED duplex full + #fi + #sleep 5 + ifenslave $VLAN_BOND $SLAVE_0 $SLAVE_1 + sleep 5 fi - MY_MODE=`cut -d ' ' -f 2 /sys/class/net/$VLAN_BOND/bonding/mode` - if [[ "$MY_MODE" != "$BOND_MODE" ]] ; then - echo $BOND_MODE \ - > /sys/class/net/$VLAN_BOND/bonding/mode - sleep 2 - fi - ip link set $VLAN_BOND up - [[ -n $MTU ]] && ip link set $VLAN_BOND mtu $MTU - if [[ -n $SPEED ]] ; then - ethtool -s $SLAVE_0 autoneg off speed $SPEED duplex full - ethtool -s $SLAVE_1 autoneg off speed $SPEED duplex full - fi - sleep 5 - ifenslave $VLAN_BOND $SLAVE_0 $SLAVE_1 - sleep 5 if [[ $VLAN == $CTLPLANE ]] ; then ip addr add $VLAN_IP/$MASK dev $VLAN_BOND GATEWAY=`cut -d ',' -f 8 <<< $VLAN_CONF`