Welcome to this video about configuring network bonding on
Oracle Linux systems using the nmcli utility.
A network bond is the grouping of multiple physical network interfaces on a system
into a single logical group interface, and connected to a network switch.
This can facilitate higher connection availability through redundancy by maintaining the connection
if a link in the bond group fails. This aggregation of physical network interfaces
also provides higher throughput by load balancing the traffic across the interfaces in the bond.
In this video we will look at creating a bond interface from the command line
using the nmcli command. Then we will delete the
bond to show how to remove one. Our system is an Oracle Linux 8 cloud instance,
with four network interfaces available. We will create a bond interface by adding
three available network interfaces as members of bond group.
All of the interfaces are connected to the same virtual cloud network private subnet.
On our terminal we first create a bond interface using the sudo nmcli connection add command.
We set the bond connection name as Bondconn1, and the interface name as bond0.
Using the sudo nmcli connection command, we can see the new bond created.
To see more detailed information of our bond interface we use the
sudo nmcli connection show command and specify the bond name in quotations marks.
We see the bond configuration file contents, showing settings like the bond ID, the UUID,
the interface name, IP settings, the bond mode used, and more.
The bond mode identifies how the bond interface distributes traffic over its links and how it
handles the failure of one or more links in the bond group by altering the behavior of
load-balancing and device failover. The modes supported are Active Backup, Round
Robin, XOR, Broadcast, 802.3ad, Adaptive transmit load balancing and Adaptive load balancing.
Bond link monitoring handles how the bond determines whether an interface is available
and identifies the appropriate balancing mechanism to apply.
The default monitoring option is MII, Media Independent Interface,
but ARP, or Address Resolution Protocol can be set if preferred.
These determine how the status of the links are determined
and when to decide if a link is down. You can find out more details of how the various
bond modes operate at this documentation link: The default bond mode applied is round robin,
using a simple round-robin scheduler to distribute traffic over the bond interfaces.
Let’s change the bond mode to be active backup. We use the sudo nmcli connection modify command,
identify the bond name, and use bond.options to set the mode to active backup.
Looking again at the bond interface details with sudo nmcli connection
show, we see the mode change. We can configure other bond parameters
but will leave those as default here. Using the sudo nmcli device command
shows us network interface information, it lists the new bond interface.
There are three other disconnected devices, which are the links we will add to our bond.
The nmcli connection add command adds physical network interfaces to the bond.
We identify the connection type information, and associate it with the new bond0 interface.
So first we add the ens5 link. And then a second link, ens6.
With sudo nmcli device we see the two connected links in the bond, bond0-if1 and bond0-if2.
With the ip addr command, we see the layer three information for our bond interface
and its two links. Shortly we will assign
an IP address to the bond. Start the bond interface with the
sudo nmcli connection up command. The bond is now up and operating.
By default the bond IP interface is configured to use DHCP.
To assign an IP address we use sudo nmcli connection modify and the ipv4.addresses
option, specifying the address and subnet.
We use the command again with the option ipv4.method manual to set the assigned address.
The ip addr command shows us our ip address configured to the bond interface.
We could also add gateway and DNS settings, but this enough for this demonstration.
Just to remind, while looking at the IP address information,
we can compare the network interfaces information by looking at the device list again.
Now we add another interface to an existing bond interface.
Using the sudo nmcli connection add command again, we identfy the third
connection that was available, ens7, and add it to the bond interface group.
With the sudo nmcli device command we see the third connection now connected.
We can view the bond configuration with the cat /proc/net/bonding/bond0 command.
The output shows the bond configuration and status, including which bond links are active,
their information and their status. To remove the bond interface we
first remove the bond links. We use the command sudo nmcli connection delete
and identify the bond link interface name. First we remove the bond0-if3 connection.
The sudo nmcli device command shows the device no longer connected.
We repeat this for the other two links, bond0-if2 and bond0-if1.
Viewing the devices, now all three are disconnected.
To delete the bond we first set the connection down with the sudo nmcli
connection down command. Viewing the devices and the
ip address information, the bond interface is now removed from the devices and ip address list, but
the bond configuration file is still in place. We use the sudo nmcli connection delete command
with the bond interface name to delete the bond interface.
The sudo nmcli connection command shows the bond interface is no longer listed.
So that’s how to create and remove
a bond interface on an Oracle Linux system using the nmcli utility.
Oracle provides an extensive number of resources which you can use to learn
about this subject and others. Use the links here to find more content
about this video as well as Oracle Linux and using Linux on Oracle Cloud Infrastructure.
That's the end of this video, thank's for watching.