How to create Bonding and test it in Linux
How to create Bonding and test it in Linux
1. Identify the Ethernet Cards , which will be enslaved in the Bonding.
2. My Enslaved interfaces are ifcfg-em3 & ifcfg-em4.
3. Following are the Configuration:
[root@testserver network-scripts]# cat ifcfg-em3
DEVICE=em3
TYPE=Ethernet
UUID=a33cdf80-0e13-496c-a168-33ba3dd5e267
ONBOOT=yes --> It is Important
NM_CONTROLLED=no
HWADDR=44:A8:42:46:0E:99
MASTER=bond0 --> It is Important
SLAVE=yes --> It is Important
[root@testserver network-scripts]# cat ifcfg-em4
DEVICE=em4
TYPE=Ethernet
UUID=10761048-a7da-491e-b2e0-7adb0f40fef2
ONBOOT=yes --> It is Important
NM_CONTROLLED=no
HWADDR=44:A8:42:46:0E:9B
IPV4_FAILURE_FATAL=yes
MASTER=bond0 --> It is Important
SLAVE=yes --> It is Important
[root@testserver network-scripts]#
DEVICE=em3
TYPE=Ethernet
UUID=a33cdf80-0e13-496c-a168-33ba3dd5e267
ONBOOT=yes --> It is Important
NM_CONTROLLED=no
HWADDR=44:A8:42:46:0E:99
MASTER=bond0 --> It is Important
SLAVE=yes --> It is Important
[root@testserver network-scripts]# cat ifcfg-em4
DEVICE=em4
TYPE=Ethernet
UUID=10761048-a7da-491e-b2e0-7adb0f40fef2
ONBOOT=yes --> It is Important
NM_CONTROLLED=no
HWADDR=44:A8:42:46:0E:9B
IPV4_FAILURE_FATAL=yes
MASTER=bond0 --> It is Important
SLAVE=yes --> It is Important
[root@testserver network-scripts]#
4. Bonding "bond0" Configuration.
[root@testserver network-scripts]# cat ifcfg-bond0
DEVICE=bond0
IPADDR=<Server IP>
NETMASK=<Netmask>
GATEWAY=<Gateway>
TYPE=Bond
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
[root@testserver network-scripts]#
DEVICE=bond0
IPADDR=<Server IP>
NETMASK=<Netmask>
GATEWAY=<Gateway>
TYPE=Bond
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
[root@testserver network-scripts]#
5. Load the Bonding Module. Set the Mode as LACP and rate as Fast.
[root@testserver network-scripts]# cat /etc/modprobe.d/bonding.conf
alias bond0
bondingoptions bond0
mode=4
miimon=100
lacp_rate=1
[root@testserver network-scripts]#
alias bond0
bondingoptions bond0
mode=4
miimon=100
lacp_rate=1
[root@testserver network-scripts]#
6. Restart the Network Service.
service network restart
7. Check the Bonding status.
ip -a
[root@testserver ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: IEEE 802.3ad
Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100Up
Delay (ms): 0
Down Delay (ms): 0
802.3ad info
LACP rate: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 4 --> this should be same
Number of ports: 2
Actor Key: 17
Partner Key: 21
Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: fullLink
Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:99
Aggregator ID: 4 --> this should be same
Slave queue ID: 0
Slave Interface: em4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:9b
Aggregator ID: 4 --> this should be same
Slave queue ID: 0
[root@testserver ~]#
[root@testserver ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP>
mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether 44:a8:42:46:0e:95 brd ff:ff:ff:ff:ff:ff
3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether 44:a8:42:46:0e:97 brd ff:ff:ff:ff:ff:ff4: em3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP qlen 1000 -- this should show as slave and master as bond0. link/ether 44:a8:42:46:0e:99 brd ff:ff:ff:ff:ff:ff5:
em4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP qlen 1000 -- this should show as slave and master as bond0. link/ether 44:a8:42:46:0e:99 brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP link/ether 44:a8:42:46:0e:99 brd ff:ff:ff:ff:ff:ff inet <Server IP>/25 brd <Gateway>27 scope global bond0 inet6 fe80::46a8:42ff:fe46:e99/64 scope link valid_lft forever preferred_lft forever[root@testserver ~]#
[root@testserver ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: IEEE 802.3ad
Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100Up
Delay (ms): 0
Down Delay (ms): 0
802.3ad info
LACP rate: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 4 --> this should be same
Number of ports: 2
Actor Key: 17
Partner Key: 21
Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: fullLink
Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:99
Aggregator ID: 4 --> this should be same
Slave queue ID: 0
Slave Interface: em4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:9b
Aggregator ID: 4 --> this should be same
Slave queue ID: 0
[root@testserver ~]#
[root@testserver ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP>
mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether 44:a8:42:46:0e:95 brd ff:ff:ff:ff:ff:ff
3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether 44:a8:42:46:0e:97 brd ff:ff:ff:ff:ff:ff4: em3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP qlen 1000 -- this should show as slave and master as bond0. link/ether 44:a8:42:46:0e:99 brd ff:ff:ff:ff:ff:ff5:
em4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP qlen 1000 -- this should show as slave and master as bond0. link/ether 44:a8:42:46:0e:99 brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP link/ether 44:a8:42:46:0e:99 brd ff:ff:ff:ff:ff:ff inet <Server IP>/25 brd <Gateway>27 scope global bond0 inet6 fe80::46a8:42ff:fe46:e99/64 scope link valid_lft forever preferred_lft forever[root@testserver ~]#
Bonding Test:
1. How to take the Interface out of bonding.
[root@testserver ~]# ifenslave -d bond0 em3
[root@testserver ~]#
[root@testserver ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
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 infoLACP rate: fastAggregator selection policy (ad_select): stableActive Aggregator Info: Aggregator ID: 5 Number of ports: 1 Actor Key: 17 Partner Key: 21 Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em4MII Status: upSpeed: 1000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: 44:a8:42:46:0e:9bAggregator ID: 5Slave queue ID: 0[root@testserver ~]# [root@testserver ~]#
[root@testserver ~]#
[root@testserver ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
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 infoLACP rate: fastAggregator selection policy (ad_select): stableActive Aggregator Info: Aggregator ID: 5 Number of ports: 1 Actor Key: 17 Partner Key: 21 Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em4MII Status: upSpeed: 1000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: 44:a8:42:46:0e:9bAggregator ID: 5Slave queue ID: 0[root@testserver ~]# [root@testserver ~]#
2. Add the Interface back to bonding.
[root@testserver ~]# ifenslave bond0 em3[root@testserver ~]# cat /proc/net/bonding/bond0Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: IEEE 802.3ad Dynamic link aggregationTransmit Hash Policy: layer2 (0)MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0
802.3ad info
LACP rate: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 5
Number of ports: 2
Actor Key: 17
Partner Key: 21
Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:9b
Aggregator ID: 5
Slave queue ID: 0
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:99Aggregator ID: 5
Slave queue ID: 0
[root@testserver ~]#
Bonding Mode: IEEE 802.3ad Dynamic link aggregationTransmit Hash Policy: layer2 (0)MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0
802.3ad info
LACP rate: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 5
Number of ports: 2
Actor Key: 17
Partner Key: 21
Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:9b
Aggregator ID: 5
Slave queue ID: 0
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:99Aggregator ID: 5
Slave queue ID: 0
[root@testserver ~]#
3. Do the same test for other Network card.
[root@testserver ~]# ifenslave -d bond0 em4
[root@testserver ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
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: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 6
Number of ports: 1
Actor Key: 17
Partner Key: 21
Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: fullLink
Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:99
Aggregator ID: 6
Slave queue ID: 0
[root@testserver ~]#
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
802.3ad info
LACP rate: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 6
Number of ports: 1
Actor Key: 17
Partner Key: 21
Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: fullLink
Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:99
Aggregator ID: 6
Slave queue ID: 0
[root@testserver ~]#
[root@testserver ~]# ifenslave bond0 em4
[root@testserver ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
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: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 6
Number of ports: 2
Actor Key: 17
Partner Key: 21
Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: fullLink
Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:99
Aggregator ID: 6
Slave queue ID: 0
Slave Interface: em4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:9b
Aggregator ID: 6
Slave queue ID: 0
[root@testserver ~]#
[root@testserver ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
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: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 6
Number of ports: 2
Actor Key: 17
Partner Key: 21
Partner Mac Address: 00:11:bb:8f:4c:00
Slave Interface: em3
MII Status: up
Speed: 1000 Mbps
Duplex: fullLink
Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:99
Aggregator ID: 6
Slave queue ID: 0
Slave Interface: em4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:46:0e:9b
Aggregator ID: 6
Slave queue ID: 0
[root@testserver ~]#
How to Configure Bridge Network on Bonded Interface in RHEL 6
How create & Configure Bonding in RHEL 7 using nmtui
No comments