Configuring a VLAN device over a bonded interface on Red Hat Enterprise Linux

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Issue

  • 802.1q VLAN tagging not working properly
  • Need to do 802.1q VLAN tagging or configure 802.1q VLAN interfaces over a bonded interface.

Resolution

Note: There is a known issue in Red Hat Enterprise Linux 6.3, if this does not not apply, then continue with the following steps.

  1. Any necessary bonding devices must be configured before continuing with the steps below. Check the output of ifconfig to be sure. Please also note that BONDING_OPTS goes in ifcfg-bondX.

    For example, bond0 with mode1.

    # cat /etc/sysconfig/network-scripts/ifcfg-bond0
    DEVICE=bond0
    ONBOOT=yes
    BOOTPROTO=none
    USERCTL=no
    BONDING_OPTS="mode=1 miimon=100"
    
  2. Configure the VLAN interface in /etc/sysconfig/network-scripts. The configuration file name should be the bond interface (dot) VLAN ID number. So, if the VLAN ID is 2, and bond interface is bond0, then the configuration filename should be ifcfg-bond0.2:

    # cat /etc/sysconfig/network-scripts/ifcfg-bond0.2
    DEVICE=bond0.2
    BOOTPROTO=none
    IPADDR=192.168.1.1
    NETMASK=255.255.255.0
    USERCTL=no
    VLAN=yes
    ONPARENT=yes
    
  3. [Optional] If multiple VLAN interfaces need to be configured, make a copy of the ifcfg-bondX.Y example from above, rename it, and edit the config file as necessary. Repeat as necessary for all VLANs on this bond:

    # cd /etc/sysconfig/network-scripts/
    # cp ifcfg-bond0.2 ifcfg-bond0.<vlanID>
    # vi /etc/sysconfig/network-scripts/ifcfg-bond0.<vlanID>
    DEVICE=bond0.<vlanID>
    BOOTPROTO=none
    IPADDR=192.168.1.X
    NETMASK=255.255.255.0
    USERCTL=no
    VLAN=yes
    ONPARENT=yes
    
  4. Restart networking:

     # service network restart
    

For more information, the Red Hat Enterprise Linux 6 Deployment Guide covers, in detail, how to configure a VLAN over a bond.

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.