Advance

NIC teaming in CentOS 7

NIC teaming in CentOS 7
1
(1)

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.

[root@eldersrv ~]# 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:

[root@eldersrv ~]# modinfo bonding

 

1- Create a bond interface file

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

[root@eldersrv 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

[root@eldersrv ~]# 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

[root@eldersrv ~]# 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

 

3- Restart the Network Service

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

[root@eldersrv ~]# 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:

[root@eldersrv ~]# 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

[root@eldersrv ~]# ifdown eno1 Device ‘eno1’ successfully disconnected. [root@eldersrv ~]#

 

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

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

View More Posts
Tom Veitch
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

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

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

+8595670151

7 days a week, 24 hours a day