Linux VLAN configuration

1. Connect the eth0 interface of your linux machine to the switch.
2. Remove the IP Address information on the eth0 interface

3. Configure 2 VLANs on the eth0 interface using vconfig as follows (100,200 are the VLAN id’s). If the 8021q.o module is not loaded, the vconfig command (when invoked first time) will automatically load the module.

4. Configure IP on the VLAN interfaces

5. Preserve the vlan configuration across reboots by adding it to configuration files. Create the appropriate ifcfg files for eth0, eth0.100 and eth0.200 in /etc/sysconfig/network-scripts/

Update /etc/sysconfig/network file to make the GATEWAYDEV use the public vlan interface.

6. The VLAN configuration on the server can be verified in the file /proc/net/vlan/config. Sample contents are shown below.

One thought on “Linux VLAN configuration

Comments are closed.