Linux Stories: Configure NIC(Network Interface Card) bonding in CentOS 7 / RHEL 7 |
|
|||||||||
Linux Stories: Configure NIC(Network Interface Card) bonding in CentOS 7 / RHEL 7 |
1 Sep 2015, 02:48 PM
Post
#1
|
|
Member Group: Members Posts: 40 Joined: 5-September 14 Member No.: 76102 Gender: |
NIC(Network Interface Card) bonding is also known as Network bonding. It can be defined as the aggregation or combination of multiple NIC into a single bond interface. Its main purpose is to provide high availability and redundancy. In this article we will learn how to configure nic or netwok bonding in CentOS 7 & RHEL 7. In my case I have two interface cards (enp0s3 & enp0s8) and will form a bond interface (bond0). PrerequisiteIf bonding module is not loaded on your linux box then use the below command to load. If bonding module is not loaded on your linux box then use the below command to load. [root@openstack ~]# modprobe bonding To list the bonding module info, use following command. [root@openstack ~]# modinfo bonding Output will be something like below Step:1 Create Bond Interface FileCreate a bond interface file (ifcfg-bond0) under the folder “/etc/sysconfig/network-scripts/”[root@openstack network-scripts]# vi ifcfg-bond0 Save & exit the file. Specify the IP address, Netmask & bonding modes as per your requirement. In my example i am using mode=5′ which is used to provide fault tolerance and load balancing. Step:2 Edit the NIC interface filesFor ifcfg-enp0s3 [root@openstack ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 For ifcfg-enp0s8 [root@openstack ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s8 Step:3 Restart the Network ServiceBelow command will restart the network service and will bring above changes into the effect.[root@openstack ~]# systemctl restart network.service Step:4 Test & Verify bond interface.Use ifconfig & ip add command to check bond interface along with its slave interfaces.Use following command to view bond interface settings like bonding mode & slave interface. [root@openstack ~]# cat /proc/net/bonding/bond0 Step:5 Fault tolerance testingTo test the fault tolerance we can down one interface and check whether you are still able access the server. [root@openstack ~]# ifdown enp0s8 Source: http://www.linuxtechi.com/configure-nic-bonding-in-centos-7-rhel-7/ |
|
Lo-Fi Version | Time is now: 28th March 2024 - 03:51 PM |
Skin and Graphics by Dan Ellis and Anubis. Hosting by Forums & More 2005-2011. |