diff --git a/scripts/setup-netdev b/scripts/setup-netdev index 61440d0..1fb20a7 100755 --- a/scripts/setup-netdev +++ b/scripts/setup-netdev @@ -52,16 +52,22 @@ for VLAN in {10..4000} ; do # Most vLANs fi ip link set $VLAN_BOND up [[ -n $MTU ]] && ip link set $VLAN_BOND mtu $MTU + AUTONEG=`cut -d ',' -f 8 <<< $VLAN_CONF | grep 'A'` + if [[ -z $AUTONEG ]] ; then + AUTONEG_FLAGS='autoneg off'; + else + AUTONEG_FLAGS=''; + fi if [[ -n $SPEED ]] ; then - ethtool -s $SLAVE_0 autoneg off speed $SPEED duplex full - ethtool -s $SLAVE_1 autoneg off speed $SPEED duplex full + ethtool -s $SLAVE_0 $AUTONEG_FLAGS speed $SPEED duplex full + ethtool -s $SLAVE_1 $AUTONEG_FLAGS speed $SPEED duplex full fi sleep 5 ifenslave $VLAN_BOND $SLAVE_0 $SLAVE_1 sleep 5 fi - UNTAGGED=`cut -d ',' -f 8 <<< $VLAN_CONF` - if [[ $UNTAGGED == 'U' ]] ; then + UNTAGGED=`cut -d ',' -f 8 <<< $VLAN_CONF | grep 'U'` + if [[ -n $UNTAGGED ]] ; then ip addr add $VLAN_IP/$MASK dev $VLAN_BOND else ip link add link $VLAN_BOND \