# 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<br></br><br></br>options bonding max_bonds=1<br></br><br></br>Edit /etc/sysconfig/network-scripts/ifcfg-eth0 it should look something like this:<br></br>DEVICE=eth0<br></br>USERCTL=no<br></br>ONBOOT=yes<br></br>MASTER=bond0<br></br>SLAVE=yes<br></br>BOOTPROTO=none<br></br>HWADDR=<br></br><br></br>Edit /etc/sysconfig/network-scripts/ifcfg-eth1 it should look something like this:<br></br>DEVICE=eth1<br></br>USERCTL=no<br></br>ONBOOT=yes<br></br>MASTER=bond0<br></br>SLAVE=yes<br></br>BOOTPROTO=none<br></br>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<br></br>BOOTPROTO=none<br></br>ONBOOT=yes<br></br>TYPE=Ethernet<br></br><br></br>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<br></br>ONBOOT=yes<br></br>TYPE=Ethernet<br></br>BOOTPROTO=static<br></br>VLAN=yes<br></br>NETMASK=255.255.255.0<br></br>NETWORK=192.168.48.0<br></br>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<br></br>HOSTNAME=<br></br>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/` )