From 5eed27b86ccbd03933546913d1cbc06cc2996c6c Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Thu, 23 Feb 2017 14:04:57 -0600 Subject: [PATCH] scripts actualizados para nuevo espacio de direcciones --- scripts/screen-netdev | 2 ++ scripts/setup-netdev | 8 ++++++-- scripts/stat-bonding | 11 +++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/screen-netdev b/scripts/screen-netdev index 967146b..4c96308 100755 --- a/scripts/screen-netdev +++ b/scripts/screen-netdev @@ -25,6 +25,8 @@ echo echo "=====> Begin setup <=====" setup-netdev +scan-hdd +scan-bonding echo "=====> Begin tests <=====" screen -c /usr/local/etc/screenrc diff --git a/scripts/setup-netdev b/scripts/setup-netdev index 11cb37b..16614cb 100755 --- a/scripts/setup-netdev +++ b/scripts/setup-netdev @@ -4,8 +4,8 @@ source scan-netdev modprobe bonding -# All vlans are using netmask /24 -MASK=24 +# All vlans are using netmask /22 +MASK=22 for VLAN in 401 402 403 404 405 406 407 408 ; do if [[ -f /etc/netdev/vlan.$VLAN.csv ]] ; then @@ -58,6 +58,10 @@ for VLAN in 401 402 403 404 405 406 407 408 ; do sleep 2 fi ip link set $VLAN_BOND up + if [[ $BOND_MODE != 1 ]] ; then + ethtool -s $SLAVE_0 autoneg off speed 10000 duplex full + ethtool -s $SLAVE_1 autoneg off speed 10000 duplex full + fi sleep 5 ifenslave $VLAN_BOND $SLAVE_0 $SLAVE_1 sleep 5 diff --git a/scripts/stat-bonding b/scripts/stat-bonding index c8b03d9..7f55fa2 100755 --- a/scripts/stat-bonding +++ b/scripts/stat-bonding @@ -16,22 +16,29 @@ while [[ 1 ]] ; do clear fi date + hostname for BOND_N in {0..4} ; do BOND=bond$BOND_N if [[ -d /sys/class/net/$BOND ]] ; then echo -n "$BOND:" - SLAVES=`cat /sys/class/net/$BOND/bonding/slaves` MODE=`cat /sys/class/net/$BOND/bonding/mode \ | cut -d ' ' -f 2` + echo " Mode: $BLD$MODE$OFF" + #echo + SLAVES=`cat /sys/class/net/$BOND/bonding/slaves` for DEV in $SLAVES ; do LINKING=`cat /sys/class/net/$DEV/operstate` if [[ "$LINKING" == "up" ]] ; then echo -n " $GRN$DEV$OFF up" + SPEED=`cat /sys/class/net/$DEV/speed` + if [[ -n $SPEED ]] ; then + echo -n " $SPEED" + fi else echo -n " $RED$DEV$OFF down" fi + done - echo -n " Mode: $BLD$MODE$OFF" echo if [[ $MODE == 1 ]] ; then ACTIVE=`cat /sys/class/net/$BOND/bonding/active_slave`