To make use of IEEE 802.1Q VLAN tagging capabilities in Ubuntu you must first install the user mode programs for Virtual LAN support:
sudo apt-get install vlan
Next the 8021q
kernel module must be loaded to enable VLAN support on a kernel level:
sudo modprobe 8021q
A quick review of lsmod
will ensure the kernel module was loaded:
lsmod | grep 8021q
The output of the command should look similar to this:
8021q 26896 0
Next we can create a tagged interface in /etc/network/interfaces
. The following example configures eth1 for VLAN 10 to use DHCP to obtain its IP address:
iface eth1.10 inet dhcp
The new VLAN 10 interface can now be initialized using:
ifup eth1.10
The usual nomenclature for making your interface come up automatically during the boot process is the same for your existing interfaces, just use eth1.10
.
Once the interface is initialized you may want to refer to the following proc locations for configuration information:
/proc/net/vlan/config
/proc/net/vlan/[vlan-device]