VLAN Configuration in Redhat Linux

Usually it is not required to configure the Vlan in a client system and the configuration is done on the switch port.
But some times you may need to tag the packets with the Vlan ID.

In Redhat Linux and its variants use the sub-interface to add the Vlan tagging functionality.

1. Make sure the 801.1q module is already loaded

lsmod | grep 8021q

2. If module is not loaded load it using modprob command

modprobe 8021q

3. Configure your physical interface in /etc/sysconfig/network-scripts/ifcfg-ethX, where X is your interface number.


4. Configure the sub-interface for the VLAN. If the Vlan ID is 100 the subinterface should be ethX.100



5. Restart the network service

service network restart

6. Check the VLAN status in /proc

cat /proc/net/vlan/ethX.100

It is possible to configure multiple vlan interfaces on a single physical interface.

You can also use the vconfig command for configuring VLAN interfaces

# vconfig add eth0 100
# ifconfig eth0.100
# ifconfig eth0.100 netmask broadcast up
# cat /proc/net/vlan/eth0.100
# ifconfig eth0.5 down
# vconfig rem eth0.100

This entry was posted in Linux and tagged . Bookmark the permalink.

2 Responses to VLAN Configuration in Redhat Linux

  1. Anonymous User says:

    Ok great…How the hell do you configure the route if you have two vlans. No one wants to explain that. After searching for a while, just frustrated.

    Lets suppose.


  2. infologs says:

    You can either configure a gateway in the ifcfg file or manually set the route through ‘ip route’ command

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s