Monday, December 17, 2007

Quickly - configuring VLANs on RHEL

  • configuration steps on RHEL (4, 5) - they have to be done as root:
    1. 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)
    2. we need to have support at the kernel level, try to load the proper module
      • modprobe 8021q
    3. configuration of interface eth0 is stored in the following file and it may contain its MAC address, IP address, netmask, network and so on
      • /etc/sysconfig/network-scripts/ifcfg-eth0
    4. to accept packets with VLAN ID 123 on that interface, run the following commands:
      • cd /etc/sysconfig/network-scripts/
      • cp ifcfg-eth0 ifcfg-eth0.123
    5. the new configuration file defines virtual interface eth0.123 of the main interface eth0, which will accept untagged packets from VLAN 123
    6. to enable VLANs on the interface eth0, append this line to the newly created configuration file
      • VLAN=yes
    7. and change the line defining interface name from eth0 to eth0.123
      • DEVICE=eth0.123
    8. correct another settings - IP address, netmask and related
    9. finally, apply the new network settings with
      • /etc/init.d/network restart
    10. check the status via proc interface
      • /proc/net/vlan/eth0.123

No comments: