Debian Enable VLANS
lsmod | grep 8021q
dpkg-query -l | grep vlan
apt-get install vlan
modprobe 8021q && echo “8021q” >> /etc/modules
ls /sys/class/net
VLAN types
802.1q – C-VID – Customer VLAN
Ethertype: 0x8100
802.1ad – S-VID – QinQ Service VLAN
Ethertype: 0x88a8 (0x9100 non-standard)
Manually Stacking VLANs
ip link add link enp1s0 enp1s0.203 type vlan proto 802.1ad id 203
ip link add link enp1s0.203 enp1s0.303 type vlan proto 802.1q id 303
ip link add link enp1s0.203 enp1s0.303 type vlan proto 80
ip link set enp1s0.293 up
Debian Interfaces file
allow-hotplug enp1s0
iface enp1s0 inet dhcp
post-up ip link add link enp1s0 enp1s0.203 type vlan proto 802.1ad id 203
auto enp1s0.203
iface enp1s0.203 inet dhcp
post-up ip link add link enp1s0.203 enp1s0.303 type vlan proto 802.1q id 303
auto enp1s0.203.303
iface enp1s0.203.303 inet dhcp
Real World example
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
#10Bge interface
auto enp6s0
iface enp6s0 inet manual
post-up ip link add link enp6s0 enp6s0.27 type vlan proto 802.1ad id 27
#service vlan 27 to sunnet
auto enp6s0.27
iface enp6s0.27 inet manual
post-up ip link add link enps6s0.27 enp6s0.27.100 type vlan proto 802.1q id 100
#customer vlan on service vlan
auto enp6s0.27.100
iface enp6s0.27.100 inet manual
#1gbe interface
auto enp8s0
iface enp8s0 inet manual
#Interface setup from eth0
auto bridge0
iface bridge0 inet dhcp
#Initial Bridge setup and add ports
bridge_ports enp6s0
up /usr/sbin/brctl addbr bridge0
# up /usr/sbin/brctl setageing bridge0 0
# up /usr/sbin/brctl stp bridge0 off
#
auto bridge1
iface bridge1 inet static
address 10.38.27.128
netmask 255.255.255.0
bridge_ports enp6s0.27
up /usr/sbin/brctl addbr bridge1