setup-netdev con default gateway
This commit is contained in:
parent
72813f0ce7
commit
b4601cd3d0
1 changed files with 3 additions and 3 deletions
|
@ -62,6 +62,9 @@ for VLAN in 110 218 222 226 306 321 480 ; do
|
||||||
sleep 5
|
sleep 5
|
||||||
if [[ $BOND_MODE == 1 ]] ; then
|
if [[ $BOND_MODE == 1 ]] ; then
|
||||||
ip addr add $VLAN_IP/$MASK dev $VLAN_BOND
|
ip addr add $VLAN_IP/$MASK dev $VLAN_BOND
|
||||||
|
if [[ -n $GATEWAY ]] ; then
|
||||||
|
ip route add default via $GATEWAY
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
ip link add link $VLAN_BOND \
|
ip link add link $VLAN_BOND \
|
||||||
name $VLAN_BOND.$VLAN \
|
name $VLAN_BOND.$VLAN \
|
||||||
|
@ -69,9 +72,6 @@ for VLAN in 110 218 222 226 306 321 480 ; do
|
||||||
ip link set $VLAN_BOND.$VLAN up
|
ip link set $VLAN_BOND.$VLAN up
|
||||||
ip addr add $VLAN_IP/$MASK dev $VLAN_BOND.$VLAN
|
ip addr add $VLAN_IP/$MASK dev $VLAN_BOND.$VLAN
|
||||||
fi
|
fi
|
||||||
if [[ -n $GATEWAY ]] ; then
|
|
||||||
ip route add default via $GATEWAY
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
systemctl restart sshd
|
systemctl restart sshd
|
||||||
|
|
Loading…
Reference in a new issue