Difference between revisions of "CentOS 7.x network bonding"
From Notes_Wiki
(Created page with "<yambe:breadcrumb>CentOS_7.x_network_management|CentOS 7.x network management</yambe:breadcrumb> =CentOS 7.x network bonding= It is possible to combine to NICs in a single bo...") |
m |
||
Line 19: | Line 19: | ||
#:</pre> | #:</pre> | ||
#:where mode=4 refers to 802.3ad or LACP. For other types of mode such as balance-rr, active-backup, balance-xor, etc. refer to reference links at the end | #:where mode=4 refers to 802.3ad or LACP. For other types of mode such as balance-rr, active-backup, balance-xor, etc. refer to reference links at the end | ||
#:In case of less information on network switch end or while using unmanageable switches, use mode=5 as that seems to be able to detect interfaces going up or down properly. | |||
# Update interface configuration files to depend on bond using: | # Update interface configuration files to depend on bond using: | ||
#:<pre> | #:<pre> | ||
Line 27: | Line 28: | ||
#::MASTER=bond0 | #::MASTER=bond0 | ||
#::SLAVE=yes | #::SLAVE=yes | ||
#::NM_CONTROLLED="no" | |||
#:</pre> | #:</pre> | ||
#::where ens0 is the name of one of the two ethernet interfaces to be added to bond | #::where ens0 is the name of one of the two ethernet interfaces to be added to bond | ||
Line 34: | Line 36: | ||
#:: systemctl restart network | #:: systemctl restart network | ||
#:</pre> | #:</pre> | ||
# Use following to make sure bond is formed properly: | |||
#:<pre> | |||
#::cat /proc/net/bonding/bond0 | |||
#:</pre> | |||
Refer: | Refer: | ||
* http://www.geekpills.com/operating-system/linux/how-to-setup-and-configure-network-bonding-in-rhelcentos-7 | * http://www.geekpills.com/operating-system/linux/how-to-setup-and-configure-network-bonding-in-rhelcentos-7 | ||
* https://www.linuxtechi.com/configure-nic-bonding-in-centos-7-rhel-7/ | |||
* https://www.linuxtechi.com/network-bonding-centos-6-rhel-6/ | |||
==Troubleshooting steps== | |||
* If in cat /proc/net/bonding/bond0 output only one interface is shown and other is not showing up then validate SLAVE=yes and MASTER=bond0 are present in the interface configuration file for the other interface. | |||
* If bond0 itself is not getting created make sure DEVICE=bond0, NAME=bond0 etc. is present in ifcfg-bond0 file | |||
<yambe:breadcrumb>CentOS_7.x_network_management|CentOS 7.x network management</yambe:breadcrumb> | <yambe:breadcrumb>CentOS_7.x_network_management|CentOS 7.x network management</yambe:breadcrumb> |
Revision as of 15:28, 28 May 2019
<yambe:breadcrumb>CentOS_7.x_network_management|CentOS 7.x network management</yambe:breadcrumb>
CentOS 7.x network bonding
It is possible to combine to NICs in a single bond interface for redundancy, performance, etc. reasons. To configure bond on top of two physical interfaces use following steps:
- Identify two identical interfaces for creating bond. These interfaces should have same speed and should be connected to same VLAN(s).
- Go to /etc/sysconfig/network-scripts/ folder
- Create 'ifcfg-bond0' with contents similar to:
- DEVICE=bond0
- NAME=bond0
- TYPE=Bond
- ONBOOT=yes
- BOOTPROTO=static
- IPADDR=192.168.122.150
- NETMASK=255.255.255.0
- GATEWAY=192.168.122.1
- BONDING_MASTER=yes
- BONDING_OPTS="miimon=0 updelay=0 downdelay=0 mode=4"
- where mode=4 refers to 802.3ad or LACP. For other types of mode such as balance-rr, active-backup, balance-xor, etc. refer to reference links at the end
- In case of less information on network switch end or while using unmanageable switches, use mode=5 as that seems to be able to detect interfaces going up or down properly.
- Update interface configuration files to depend on bond using:
- DEVICE=ens0
- ONBOOT=yes
- TYPE=Ethernet
- BOOTPROTO=none
- MASTER=bond0
- SLAVE=yes
- NM_CONTROLLED="no"
-
- where ens0 is the name of one of the two ethernet interfaces to be added to bond
- Do the same for second ethernet interface
- Restart network for settings to take effect:
- systemctl restart network
- Use following to make sure bond is formed properly:
- cat /proc/net/bonding/bond0
Refer:
- http://www.geekpills.com/operating-system/linux/how-to-setup-and-configure-network-bonding-in-rhelcentos-7
- https://www.linuxtechi.com/configure-nic-bonding-in-centos-7-rhel-7/
- https://www.linuxtechi.com/network-bonding-centos-6-rhel-6/
Troubleshooting steps
- If in cat /proc/net/bonding/bond0 output only one interface is shown and other is not showing up then validate SLAVE=yes and MASTER=bond0 are present in the interface configuration file for the other interface.
- If bond0 itself is not getting created make sure DEVICE=bond0, NAME=bond0 etc. is present in ifcfg-bond0 file
<yambe:breadcrumb>CentOS_7.x_network_management|CentOS 7.x network management</yambe:breadcrumb>