From ee63874c72694c780b514ac53aaddf42352893b5 Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Wed, 24 Nov 2021 13:25:09 -0600 Subject: [PATCH] =?UTF-8?q?Flag=20de=20autonegociaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/setup-netdev | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 \