First Commit
This commit is contained in:
commit
bd67283438
142 changed files with 5061 additions and 0 deletions
48
addbridgevlan.sh
Executable file
48
addbridgevlan.sh
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# version 231012_1439
|
||||
#
|
||||
|
||||
read -p "Enter VLAN Number (Ex: 16) : " VLAN
|
||||
|
||||
read -p "Enter Device Name (Ex: enp5s0) : " DEV
|
||||
|
||||
echo -e "
|
||||
VLAN = $VLAN
|
||||
Device = $DEV
|
||||
"
|
||||
|
||||
|
||||
if [ "$(nmcli con |grep br${VLAN}|wc -l)" -eq "0" ]
|
||||
then
|
||||
echo -e "** Adding bridge br${VLAN}..."
|
||||
nmcli con add \
|
||||
type bridge \
|
||||
con-name br${VLAN} \
|
||||
ifname br${VLAN} \
|
||||
ipv4.method disabled \
|
||||
ipv6.method ignore \
|
||||
autoconnect yes
|
||||
else
|
||||
echo "** br${VLAN} found"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo -e "** Putting br${VLAN} in up state..."
|
||||
nmcli con up "br${VLAN}"
|
||||
|
||||
|
||||
echo -e "** Adding VLAN ${VLAN} to $DEV --> vlan-${DEV}.${VLAN} and then to br${VLAN}"
|
||||
nmcli con add \
|
||||
type vlan \
|
||||
con-name vlan-${DEV}.${VLAN} \
|
||||
ifname ${DEV}.${VLAN} \
|
||||
dev ${DEV} \
|
||||
id ${VLAN} \
|
||||
ipv4.method disabled \
|
||||
ipv6.method ignore \
|
||||
master br${VLAN} \
|
||||
autoconnect yes
|
||||
|
||||
echo -e "\n** All done."
|
||||
Loading…
Add table
Add a link
Reference in a new issue