The article shows steps to create VLAN sub-interface on Ubunru Linux
Install vconfig utility:
sudo apt-get install vlan
Load kernel module:sudo modprobe 8021q
Create a new interface that is a member of a specific VLAN, VLAN id 100. We use the physical interface ens6 in this example. This command will add an additional interface next to the interfaces which have been configured already
sudo vconfig add ens6 100
Assign address to newly created interface:
sudo ip addr add 10.13.0.11/16 dev ens6.100
To make this setup permanent. Add the module to the kernel on boot:
sudo su -c 'echo "8021q" >> /etc/modules'
Create the interface and make it available when the system boots. Add the following lines to
/etc/network/interfaces
:auto ens6.100
iface ens6.100 inet static
vlan-raw-device ens6
address 10.13.0.11
netmask 255.255.0.0
iface ens6.100 inet static
vlan-raw-device ens6
address 10.13.0.11
netmask 255.255.0.0