#======================================================================================= © 2016-2018 Martineau 'Router-on-a-stick' v1.18
#
# Configure RT-AC68U LAN Port X as VLAN Trunk for tagged VLAN nnn to downstream switch(s) on separate subnet using '/etc/dnsmasq.conf' or simply assign Port X to a separate subnet.
#
#
# Usage: VLANSwitch ['help'|''-h''] | [ [''vlan_id''] [switch_port] ]
# [ ['status' ['verbose'] ['diag'] ['del'['nvram']] ['vpn'[n]] ['vlanfw'] ['nodnsmasq'] ['autodnsmasq'] ['alias='vlan_alias] ['debug'] ['bridge'] ['tcqdisc']
#
# VLANSwitch 200
# Switch port 4 will have vlan200 tagged to it
# VLANSwitch 200 del
# Switch port 4 will have vlan200 removed
# VLANSwitch 50 status
# Show the connected VLAN devices (or Bridge if VLAN is enslaved to one)
# VLANSwitch 50 status verbose
# Show the vlan configuration and statistics etc.
# VLANSwitch 20 3 vpn2
# Switch port 3 will have vlan20 tagged to it and will be forced via the VPN Client 2 (on bridge br2)
# and the alias will be taken from the VPN Client GUI 'description' if it exists (Firmware >v380.xx)
# or will be taken from '/etc/iproute2/rt_tables' e.g. 'ovpnc2'
# VLANSwitch 30 vpn1 vlanfw
# Switch port 4 will have vlan30 tagged to it and will be forced via the VPN Client 1 (on bridge br1)
# Firewall rules will explicitly use vlan30 rather than vlan+
# VLANSwitch 130 nodnsmasq
# Switch port 4 will have vlan130 tagged to it, and vlan130 does not need to exist in /etc/dnsmasq.conf
# VLANSwitch 150 autodnsmasq
# Switch port 4 will have vlan150 tagged to it, and /jffs/configs/dnsmasq.conf.add will be modified
# NOTE: dnsmasq will be auto-restarted.
# VLANSwitch 10 1 bridge notag
# Switch port 1 will ONLY be vlan10 (not a tagged port), and bridge br10 using vlan111 will be created.
# This method is for environments without additional downstream VLAN capable switches
# VLANSwitch 10 1 bridge notag del
# Switch port 1 will have vlan10 removed, and bridge br10 will be deleted
# VLANSwitch 10 1 bridge notag tcqdisc
# Switch port 1 will ONLY be vlan10 (not a tagged port), and bridge br10 using vlan111 will be created and 'tc qdisc' will be added