Skip to main content

RHEL VLAN and Bonding Configuration

Check list:

  • Check whether the 8021q module has been loaded.
  • lsmod | grep 8021q
  • If the 8021q module is not loaded, run the following command to load it: modprobe 8021q

Configuration

Add the following lines to /etc/modprobe.conf :

alias bond0 bonding

options bonding max_bonds=1

Edit /etc/sysconfig/network-scripts/ifcfg-eth0 it should look something like this:
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
HWADDR=

Edit /etc/sysconfig/network-scripts/ifcfg-eth1 it should look something like this:
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
HWADDR=

Now create the Bond0 interface:

NOTE: No IP address will be assigned to the bond0 device.

Create a new file /etc/sysconfig/network-scripts/ifcfg-bond0 it should look like this:

DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet

BONDING_OPTS="mode=1 miimon=100"

NOTE: mode could be different, these are the mode options, but if Blade server is using Virtual Connect user should use mode=1.

mode=0 (balance-rr) Round-robin
mode=1 (active-backup) Active-backup
mode=2 (balance-xor) XOR
mode=3 (broadcast) Broadcast
mode=4 (802.3ad) IEEE 802.3ad Dynamic link aggregation
mode=5 (balance-tlb) Adaptive transmit load balancing
mode=6 (balance-alb) Adaptive load balancing

The first four modes are the most commonly used:

VLAN tag setup

This will be a virtual interface with a VLAN tag of 48. User's VLAN set-up is most likely different so just replace 48 with the VLAN tag of user's network. i.e. bond1.50 would be the bonded interface for VLAN 50.

Create a new file /etc/sysconfig/network-scripts/ifcfg-bond0.48 it should look like this:

DEVICE=bond0.48
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
VLAN=yes
NETMASK=255.255.255.0
NETWORK=192.168.48.0
IPADDR=192.168.48.100

Ensure that the default gateway in this configuration is recorded in the /etc/sysconfig/network file otherwise it may not work properly. Once done, it should look something like:

NETWORKING=yes
HOSTNAME=
GATEWAY=192.168.48.1

User has now setup bonding and VLAN tagging. User needs to restart networking to make the changes active.

service network restart

Testing

Verify bonding interface is up and running

ifconfig -a

Verify configuration (RHEL 5 is using sysfs , so check out /sys/class/net/ )