- we have already configured eth0 interface which is accessible from the network and we want to add VLAN support to it, e.g. to accept packets tagged with VLAN ID 123 (avoid using VLAN ID 1, it is often used as administration VLAN)
- we need to have support at the kernel level, try to load the proper module
- modprobe 8021q
- you don't need to know how to modify configuration file's of interface eth0 because we are going to use the vconfig command to do it
- to turn on VLAN ID 123 on the interface eth0, use the command:
- vconfig add eth0 123
- check that the previous command was applied successfully, you can use ifconfig command of course:
- ifconfig eth0.123
- finally, configure the remaining settings you want to set for the interface eth0, do it with ifconfig again
- to make the changes persistent place the commands to some rc script or create your own init script and enable it during system boot
- to check the status, kernel has exported some status information here:
- cat /proc/net/vlan/eth0.123
- if you want to remove the interface, try these two:
- ifconfig eth0.123 down
- vconfig rem eth0.123
tips and tricks, news, reviews, tutorials about Linux and various Unixes, VMware, virtualization, scripting ...
Tuesday, January 29, 2008
Quickly - configuring VLANs on Linux
This post is similar to the one about configuring VLANs on RHEL but is applicable on any Linux distribution. VLANs support has been included into the Linux kernel since version 2.4.14. Earlier versions requires to be patched properly. More about it and patches is placed here. Again, configuration steps which requires to be done as root:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment