Setup VLAN on Linux

This is a short tutorial how to setup a VLAN on Linux based operating systems (in my case OpenFiler)

In this example we setup a VLAN 2 on the interface eth0!

First we copy the ecisting ifcfg-eth0 to the new VLAN ifcfg-eth0.2

# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.2

Now open the new ifcfg-eth0.2 with vi or your prefered editor and change the „DEVICE=eth0″ to“DEVICE=eth0.2“ and append a line „VLAN=yes“
Don’t forgett to setup the right IP address on the new interface (static or dhcp)

After that we have the following configuration

* eth0 –> Your regular network interface
* eth0.2 –> Your virtual interface that use untagged frames!

To activate the changes we have to restart the network service
# /etc/init.d/network restart

Kommentar verfassen