wifinigel.MikrotikScripting/scripts/v6/ch10-11-add-remove-vlans.rsc
Tomas Abad 78cac6a07c Cosmetic
Headers of files unified.
2023-05-31 18:14:19 +02:00

23 lines
584 B
Text

# filename: ch10-11-add-remove-vlans.rsc
# a script to add and remove 50 VLANs to/from
# a Mikrotik router interface
# find LAN interface ID
:local LanInterface "ether2";
:local LanInterfaceId [/interface find default-name=$LanInterface];
:for VlanId from 200 to 249 do={
# add VLAN to LAN interface
:local VlanName "VLAN$VlanId";
/interface vlan add name="$VlanName" vlan-id=$VlanId \
interface=$LanInterfaceId;
}
:for VlanId from 200 to 249 do={
# add VLAN to LAN interface
:local VlanName "VLAN$VlanId";
/interface vlan remove "$VlanName";
}