Search This Blog

2013-04-16

Create a VLAN Interface in Linux

Vconfig Method


Add a VLAN interface

vconfig add (interface_name) (vlan_id)
ifconfig (interface_name).(vlan_id) (ip_address) netmask (net_mask)

Remove the VLAN interface

ifconfig (interface_name).(vlan_id) down
vconfig rem (interface_name).(vlan_id)

Persisting Changes

Copy existing interface config to new sub-interface vlan config
cp /etc/sysconfig/network-scripts/ifcfg-(interface_name) /etc/sysconfig/network-scripts/ifcfg-(interface_name).(vlan_id)
vi /etc/sysconfig/network-scripts/ifcfg-(interface_name).(vlan_id)
DEVICE=ifcfg-(interface_name).(vlan_id)
Append the line
VLAN=yes
Restart networking
/etc/init.d/network restart

https://wiki.archlinux.org/index.php/VLAN#Create_the_VLAN_device
http://www.cyberciti.biz/tips/howto-configure-linux-virtual-local-area-network-vlan.html
http://unixfoo.blogspot.ca/2007/12/linux-vlan-configuration.html
http://www.packetpro.com/~peterson/linux-vlans.html

No comments:

Post a Comment