DEV Community

Cover image for NIC Bonding and Everything you need to know using RHEL 9
Rishita Shaw
Rishita Shaw

Posted on

NIC Bonding and Everything you need to know using RHEL 9

NIC
Network interface cards (NICs) enable computers to connect to a network by installing hardware components, usually circuit boards or chips. In addition to supporting I/O interrupts, direct memory access (DMA) interfaces, data transmission, network traffic engineering, and partitioning, modern NICs also provide computers with a number of other functions.

To find info about your NIC use the command and sign in as the root user.

ethtool <INTERFACE_NAME>

Now, to know your NIC name use the command ifconfig. There are several NICs like lo, virbr0, etc. but we want to take the first one that comes on.

ifconfig | more

ifconfig

Here our NIC is enp0s3, Now use the command ethtool enp0s3

ethtool

now that you have the network information, you should see a few of the things mentioned like link modes, speed, duplex, etc.

NIC Bonding
Now that you know what NIC is, let’s dive into NIC bonding also known as network bonding. It can be defined as the aggregation and combination of multiple NICs into a single bond interface. Its main purpose is to provide high availability and redundancy.

How to do NIC Bonding?
Make sure you've enabled two or more network adapters from Virtual Box settings

  • Add a new NIC if it does not exist
  • Install bonding driver = modprobe bonding
  • To list the bonding module info = modinfo bonding _You will see the driver version as seen below if the driver is installed and loaded _

driver

Create Bond Interface File
vi /etc/sysconfig/network-scripts/ifcfg-bond0

Add the following parameters
DEVICE=bond0
TYPE=Bond
NAME=bond0
BONDING_MASTER=yes
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.80
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
BONDING_OPTS=”mode=5 miimon=100”

Save and exit the file

The bonding options details are can be found on the following table

NIC Bonding options

miimon
Specifies the MII link monitoring frequency in milliseconds. This determines how often the link state of each slave is inspected for link failures

Edit the First NIC File (enp0s3)
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

Delete the entire content
Add the following parameters

TYPE=Ethernet
BOOTPROTO=none
DEVICE=enp0s3
ONBOOT=yes
HWADDR=”MAC from the ifconfig command”
MASTER=bond0
SLAVE=yes

Save and exit the file

Create the Second NIC File (enp0s8) or Copy enp0s3
vi /etc/sysconfig/network-scripts/ifcfg-enp0s8

Add the following parameters
TYPE=Ethernet
BOOTPROTO=none
DEVICE=enp0s8
ONBOOT=yes
HWADDR=”MAC from the ifconfig command”
MASTER=bond0
SLAVE=yes

Save and exit the file

Restart the Network Service
systemctl restart network

Test and verify the configuration
ifconfig or ifconfig | more

_Use following command to view bond interface settings like bonding mode & slave interface
_
cat /proc/net/bonding/bond0

That NIC Bonding complete overview on Red Hat Enterprise Linux operating system 9. If you like it do give a follow!

Top comments (0)

The discussion has been locked. New comments can't be added.