Configuring VLANs in Ubuntu Server

Install the Vlan package:

sudo apt-get install vlan

Download the Vlan module (802.1q):

sudo modprobe 8021q

We make it to load automatically when the system starts:

sudo  sh -c 'grep -q 8021q /etc/modules || echo 8021q >> /etc/modules'

We edit the configuration file for the network interfaces /etc/network/interfaces eg the nano editor:

sudo nano /etc/network/interfaces

Add a VLAN interface to it:

auto eth0.5
iface eth0.5 inet static
address 192.168.5.1
netmask 255.255.255.0

We start the prescribed network interface:

sudo ifup eth0.5

See also:
Adding vlan to Ubuntu for ABillS

Leave a Reply