setup-netdev busca la U UNTAGGED en el campo 8

This commit is contained in:
Sandino Araico Sanchez 2021-11-23 17:26:43 -06:00
parent 2b1dd7c74f
commit 8929ad09b8

View file

@ -5,7 +5,7 @@ modprobe bonding
# All vlans are using netmask /22
MASK=22
CTLPLANE=110 # ctlplane vlan #Fixme: hardcoded
#CTLPLANE=110 # ctlplane vlan #Fixme: hardcoded
#VLANS='110 218 222 226 306 321 480 1000'
SPEED=25000
MTU=9000
@ -60,12 +60,9 @@ for VLAN in {10..4000} ; do # Most vLANs
ifenslave $VLAN_BOND $SLAVE_0 $SLAVE_1
sleep 5
fi
if [[ $VLAN == $CTLPLANE ]] ; then
UNTAGGED=`cut -d ',' -f 8 <<< $VLAN_CONF`
if [[ $UNTAGGED == 'U' ]] ; then
ip addr add $VLAN_IP/$MASK dev $VLAN_BOND
GATEWAY=`cut -d ',' -f 8 <<< $VLAN_CONF`
if [[ -n $GATEWAY ]] ; then
ip route add default via $GATEWAY
fi
else
ip link add link $VLAN_BOND \
name $VLAN_BOND.$VLAN \
@ -73,6 +70,10 @@ for VLAN in {10..4000} ; do # Most vLANs
ip link set $VLAN_BOND.$VLAN up
ip addr add $VLAN_IP/$MASK dev $VLAN_BOND.$VLAN
fi
GATEWAY=`cut -d ',' -f 9 <<< $VLAN_CONF`
if [[ -n $GATEWAY ]] ; then
ip route add default via $GATEWAY
fi
done
systemctl restart sshd