Setup Ethernet Bonding on RHEL 6

Scenario: Configure 4 ethernet into 2 ethernet bond0 and bond1 on RHEL 6/CentOS 6.
System: RHEL 6.9

Steps:
1) Create new file bond0 (Eth0+Eth1) with IP Address = 172.16.10.70
# vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=172.16.10.70
NETMASK=255.255.255.0
TYPE=Bond
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
USERCTL=no
PEERDNS=yes
IPV6INIT=no

– Configure Eth0:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=14:02:ec:44:60:f1
MASTER=bond0
SLAVE=yes
IPV6INIT=no
USERCTL=no
PEERDNS=yes

– Configure Eth1:
# vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=14:02:ec:44:60:f2
MASTER=bond0
SLAVE=yes
IPV6INIT=no
USERCTL=no
PEERDNS=yes

2) Create new file Bond1 (Eth2+Eth3) with IP Address = 172.16.110.70
# vi /etc/sysconfig/network-scripts/ifcfg-bond1

DEVICE=bond1
IPADDR=172.16.110.70
NETMASK=255.255.255.0
TYPE=Bond
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
USERCTL=no
PEERDNS=yes
IPV6INIT=no

– Configure Eth2:
# vi /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=114:02:ec:8e:d4:e0
MASTER=bond1
SLAVE=yes
IPV6INIT=no
USERCTL=no
PEERDNS=yes

– Configure Eth3:
# vi /etc/sysconfig/network-scripts/ifcfg-eth3

DEVICE=eth3
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
HWADDR=114:02:ec:8e:d4:e1
MASTER=bond1
SLAVE=yes
IPV6INIT=no
USERCTL=no
PEERDNS=yes

3) Configure ethernet bonding mode (in this scenario bonding mode is LACP).
List of bonding mode:
– balance-rr or 0 — round-robin mode for fault tolerance and load balancing.
– active-backup or 1 — Sets active-backup mode for fault tolerance.
– balance-xor or 2 — Sets an XOR (exclusive-or) mode for fault tolerance and load balancing.
– broadcast or 3 — Sets a broadcast mode for fault tolerance. All transmissions are sent on all slave interfaces.
– 802.3ad or 4 — Sets an IEEE 802.3ad dynamic link aggregation mode. Creates aggregation groups that share the same speed & duplex settings.
– balance-tlb or 5 — Sets a Transmit Load Balancing (TLB) mode for fault tolerance & load balancing.
– balance-alb or 6 — Sets an Active Load Balancing (ALB) mode for fault tolerance & load balancing.

– Create new file.
# vi /etc/modprobe.d/bonding.conf

alias bond0 bonding
options bond0 mode=802.3ad miimon=100

alias bond1 bonding
options bond1 mode=802.3ad miimon=100

4) Try service network restart or reboot the server.
5) Check the bonding configuration if successfull will show the ip address and you can ping to the server.
# ifconfig

[root@IDTEST01 ~]# ifconfig
bond0 Link encap:Ethernet HWaddr 14:02:EC:44:60:F1
 inet addr:172.16.10.70 Bcast:172.16.10.255 Mask:255.255.255.0
 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
 RX packets:899570 errors:0 dropped:0 overruns:0 frame:0
 TX packets:25078 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:106434060 (101.5 MiB) TX bytes:3209082 (3.0 MiB)

bond1 Link encap:Ethernet HWaddr 114:02:EC:8E:D4:E0
 inet addr:172.16.110.70 Bcast:172.16.110.255 Mask:255.255.255.0
 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
 RX packets:2788618 errors:0 dropped:0 overruns:0 frame:0
 TX packets:1661289 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:3170316042 (2.9 GiB) TX bytes:299865190 (285.9 MiB)

[root@IDTEST01 ~]#

6) Verify the Status of bond interface.
# cat /proc/net/bonding/bond0

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

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
 Aggregator ID: 4
 Number of ports: 2
 Actor Key: 11
 Partner Key: 32780
 Partner Mac Address: 00:23:04:ee:be:0b

Slave Interface: eth0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 14:02:ec:44:60:f1
Aggregator ID: 4
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 14:02:ec:44:60:f2
Aggregator ID: 4
Slave queue ID: 0
[root@IDTEST01 ~]#

Finish.

Reference:
https://www.linuxtechi.com/network-bonding-centos-6-rhel-6/


Leave a Reply

Your email address will not be published. Required fields are marked *