RHEL 7.1 Network Interface Bonding

It seems that setting up NIC bonding in RHEL7.1 is the same as in CentOS, then again why wouldn’t it be, this is what worked for me.

Make sure you’re in /etc/sysconfig/network-scripts

First create the ifcfg-bond0 file

DEVICE=bond0
IPADDR=xx.xx.xx.xx
NETMASK=xx.xx.xx.xx
GATEWAY=xx.xx.xx.xx
NM_CONTROLLED=no
BOOTPROTO=none
ONBOOT=yes
USERCTL=no

Next we’ll edit the ifcfg-eno1/2 files

ifcfg-eno1

DEVICE=eno1
USERCTL=no
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

The only difference between the eno1/2 files are device, just make sure eno1 says eno1 etc

next we’ll created bonding.conf in /etc/modprobe.d

alias bond0 bonding
options bond0 mode=balance-rr miimon=100 downdelay=200 updelay=200

ok to explain the options a little

mode

Mode 0 (balance-rr)
This mode transmits packets in a sequential order from the first available slave through the last. If two real interfaces are slaves in the bond and two packets arrive destined out of the bonded interface the first will be transmitted on the first slave and the second frame will be transmitted on the second slave. The third packet will be sent on the first and so on. This provides load balancing and fault tolerance.

Mode 1 (active-backup)
This mode places one of the interfaces into a backup state and will only make it active if the link is lost by the active interface. Only one slave in the bond is active at an instance of time. A different slave becomes active only when the active slave fails. This mode provides fault tolerance.

Mode 2 (balance-xor)
Transmits based on XOR formula. (Source MAC address is XOR’d with destination MAC address) modula slave count. This selects the same slave for each destination MAC address and provides load balancing and fault tolerance.

Mode 3 (broadcast)
This mode transmits everything on all slave interfaces. This mode is least used (only for specific purpose) and provides only fault tolerance.

Mode 4 (802.3ad)
This mode is known as Dynamic Link Aggregation mode. It creates aggregation groups that share the same speed and duplex settings. This mode requires a switch that supports IEEE 802.3ad Dynamic link.

Mode 5 (balance-tlb)
This is called as Adaptive transmit load balancing. The outgoing traffic is distributed according to the current load and queue on each slave interface. Incoming traffic is received by the current slave.

Mode 6 (balance-alb)
This is Adaptive load balancing mode. This includes balance-tlb + receive load balancing (rlb) for IPV4 traffic. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the server on their way out and overwrites the src hw address with the unique hw address of one of the slaves in the bond such that different clients use different hw addresses for the server.

miimon

Specifies the MII link monitoring frequency in milliseconds. This determines how often the link state of each slave is inspected for link failures.

Downdelay

Specifies the time, in milliseconds, to wait before disabling a slave after a link failure has been detected.

Updelay

Specifies the time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.

Simples ?

I then ran this from the command line

modprobe bonding mode=balance-rr miimon=100 downdelay=200 updelay=200

It’s at this point, after realizing I’m a pillock, that I lost my ssh connection so I couldn’t restart networking, oh well off to the server I go.  you could just run the same command above with ; reboot at the end or if you’re really sensible, do the configuration from the server itself instead of using SSH.

restart networking or reboot the server.

Once back up you can check the bonding is working

[paulmellors@rmcstorage01 ~]$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200

Slave Interface: eno1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:25:64:3b:43:21
Slave queue ID: 0

Slave Interface: eno2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:25:64:3b:43:22
Slave queue ID: 0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s