Advance

NIC teaming in CentOS 7

NIC teaming in CentOS 7

In the following of Linux tutorials, in this article, you will learn about NIC teaming in CentOS 7. But first, what is NIC? the Network Interface Card is also known as Network bonding which can be defined as the aggregation or combination of multiple NIC  into a single bond interface. The main purpose of NIC is to provide high availability and redundancy.

 

Prerequisite :

Your bonding module must be loaded on your Linux box. If it is not, use the below command.

[[email protected] ~]# modprobe bonding
Recommended Article: How to crack Linux VPS

NIC teaming in CentOS 7

Follow this guide to learn how to configure nic or network bonding in CentOS 7 & RHEL 7. we start with two interface cards (enp0s3 & enp0s8) and will form a bond interface (bond0).

List the bonding module-info:

[[email protected] ~]# modinfo bonding

 

1- Create a bond interface file

First , create a bond interface file (ifcfg-bond0) under the folder “/etc/sysconfig/network-scripts/

[[email protected] network-scripts]# vi ifcfg-bond0  DEVICE=bond0  TYPE=Bond  NAME=bond0  BONDING_MASTER=yes  BOOTPROTO=none  ONBOOT=yes  IPADDR=192.168.10.70  NETMASK=255.255.255.0  GATEWAY=192.168.10.1  BONDING_OPTS="mode=5 miimon=100"

You can save and close the file now.

Next, specify the IP address, Netmask & bonding modes. Here we select ‘mode=5′ which is used to provide fault tolerance and load balancing.

 

2- Edit the NIC interface files

For ifcfg-eno1

[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno1  TYPE=Ethernet  BOOTPROTO=none  DEVICE=eno1  ONBOOT=yes  HWADDR="08:00:26:79:60:b9"  MASTER=bond0  SLAVE=yes    

For ifcfg-eno2

[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eno2  TYPE=Ethernet  BOOTPROTO=none  DEVICE=eno2  ONBOOT=yes  HWADDR="08:00:26:ed:71:2d"  MASTER=bond0  SLAVE=yes

 

Buy Linux Web Hosting

 

3- Restart the Network Service

By the following command, you can restart the network service and bring the above changes into the effect.

[[email protected] ~]# systemctl restart network.service

 

4- Test and verify the bond interface

To check the bond interface along with its slave interfaces, Use ‘ifconfig‘ & ‘ip add‘ command.

 

To view bond interface settings like bonding mode and slave interface:

[[email protected] ~]# cat /proc/net/bonding/bond0

5- Fault tolerance testing

You can down one interface and check whether you are still able to access the server, to test the fault tolerance

[[email protected] ~]# ifdown eno1 Device ‘eno1’ successfully disconnected. [[email protected] ~]#

 

Good job! You learned how to configure NIC(Network Interface Card) bonding in CentOS 7 / RHEL 7.

Dear user, we hope you would enjoy this tutorial NIC teaming in CentOS 7, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problems in it.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave Your Comment

Your email address will not be published.

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+18054214518

7 days a week, 24 hours a day