0% found this document useful (0 votes)
9 views21 pages

Redhat Tutorial

This document provides a comprehensive guide on configuring network bonding in Linux using both Netplan and nmcli for high availability. It explains the benefits of network bonding, including redundancy and load balancing, and outlines step-by-step instructions for setting up and verifying the configuration. Additionally, it covers how to change the IP address of a bond interface and answers common questions related to bonding modes and testing functionality.

Uploaded by

Syed zaidi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views21 pages

Redhat Tutorial

This document provides a comprehensive guide on configuring network bonding in Linux using both Netplan and nmcli for high availability. It explains the benefits of network bonding, including redundancy and load balancing, and outlines step-by-step instructions for setting up and verifying the configuration. Additionally, it covers how to change the IP address of a bond interface and answers common questions related to bonding modes and testing functionality.

Uploaded by

Syed zaidi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Configuring Network Bonding In Linux For High Availability

A Step-by-Step Guide to Setting Up Network Bonding in Linux Using Netplan and nmcli.

Network bonding in Linux is a technique that allows you to combine multiple network interfaces
(NICs) into a single logical interface for improved redundancy and performance.
Network bonding, also known as NIC bonding or teaming, is a method of combining two or more
network interfaces into a single logical interface called a bond.
The two important benefits of configuring network bonding in Linux:
Redundancy: Bonding provides failover capabilities, ensuring network connectivity even if one
interface fails. Also called (Active-Backup) Mode, only one interface will be active other will be
standby, if active fail then other backup interface takeover, This mode is ideal for redundancy, ensuring
that your network remains operational even if one NIC goes down.
Load Balancing: It can distribute network traffic across bonded interfaces, improving overall network
performance. Also called (Round Robin) Mode , both interface are working in a round robin fashion
to each bonded interface. This mode is useful when you want to distribute traffic evenly across
interfaces.

Method 1 - Setting Up Network Bonding in Linux using Netplan


Creating network bonding using Netplan in Linux is a straightforward process. Netplan is a
YAML-based network configuration utility used in modern Linux distributions like Ubuntu. To
set up network bonding, follow these steps:

1. Check Network Interface Names


Before creating a Netplan configuration for network bonding, it's essential to identify the
names of the network interfaces you want to bond.

You can use the ip link show or ifconfig commands to list the available network interfaces.
Typically, these interfaces have names like enp0sX or, ensX or, ethX.

$ ip link show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode


DEFAULT group default qlen 1000

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state


UP mode DEFAULT group default qlen 1000
link/ether 6e:26:0b:8e:33:8c brd ff:ff:ff:ff:ff:ff
altname enp0s18
3: ens19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
UP mode DEFAULT group default qlen 1000
link/ether 96:d2:11:4a:6d:ad brd ff:ff:ff:ff:ff:ff
altname enp0s19
4: ens20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
UP mode DEFAULT group default qlen 1000
link/ether ea:3a:8b:6c:38:e1 brd ff:ff:ff:ff:ff:ff
altname enp0s20

As you can see, my system have three network interfaces namely ens18, ens19, and ens20.

2. Create a Netplan Configuration File


Create or edit a Netplan configuration file. Netplan configuration files are typically stored in
the /etc/netplan/ directory and have a .yaml extension. You can use any text editor to create
or edit the configuration file, such as nano or vim or vi.
For example, create a file named [Link]:

$ sudo nano /etc/netplan/[Link]

3. Configure the Bond Interface


In the Netplan configuration file, define the bond interface and its parameters. Here's a
sample configuration for creating a bond with three interfaces (ens18, ens19 and ens34) in
active-backup mode:

network:
version: 2
renderer: networkd
ethernets:
ens18:
dhcp4: no
ens19:
dhcp4: no
ens20:
dhcp4: no
bonds:
bond0:
interfaces: [ens18, ens19, ens20]
addresses: [[Link]/24]
routes:
- to: [Link]/0
via: [Link]
nameservers:
addresses: [[Link], [Link]]
parameters:
mode: active-backup / balance-rr (for round robin) or 802.3ad (LACP) link aggregation control protocol
primary: ens18

4. Apply the Configuration


After creating or editing the Netplan configuration file, apply the changes using the netplan
apply command:

$ sudo netplan apply

5. Verify the Configuration


Check the status of your bonded interface using the ip link or ifconfig commands. For
example:

$ ip link show bond0

You should see the bonded interface (bond0) and its status.

6. Test Network Connectivity


Ensure that your server or workstation can access the network through the bonded interface.
You can ping other devices on the network to verify connectivity.

Method 2 - Configure Network Bonding in Linux using nmcli


To create network bonding using the nmcli command in Linux, you can follow these
steps. nmcli is a command-line utility for managing NetworkManager, a network
configuration tool commonly used in many Linux distributions.

1. Check Network Interface Names


Before creating a bonded interface using nmcli, you should identify the names of the network
interfaces you want to bond.
You can use the ip link show or ifconfig commands to list the available network interfaces.
The interfaces typically have names like ensX or enp0sX or ethX.

$ ip link show

Sample Output:

As you see in the above output, I have three network interfaces


namely ens18, ens19 and ens20.
2. Check NetworkManager Status
Ensure that NetworkManager is installed and running on your system. You can check its
status with the following command:

$ sudo systemctl status NetworkManager

If it's not running, you can start it using:

$ sudo systemctl start NetworkManager

$ sudo systemctl enable NetworkManager


3. Create a New Bond Connection
You can create a new bond connection using the nmcli command. Here's the basic syntax:

$ sudo nmcli connection add type bond ifname bond0 mode MODE_NAME

Replace bond0 with the name you want to give to your bonded interface, and
replace MODE_NAME with the bonding mode you want to use, such as active-backup, balance-rr,
or 802.3ad.
For example, to create a bond called bond0 in active-backup mode:

$ sudo nmcli connection add type bond ifname bond0 mode active-backup

This command will create new network connection named 'bond-bond0'.

Connection 'bond-bond0' (e68041f8-d836-4b83-a743-1bcadec9d19e) successfully


added.

4. Add Member Interfaces


Now, you need to add the network interfaces that you want to include in the bond as
member interfaces.

For example, I am going to add ens19 and ens20 as the members of the bond0 interface
using nmcli command.
Replace ens19 and ens20 with the names of your actual network interfaces:

$ sudo nmcli connection add type ethernet ifname ens19 master bond0

$ sudo nmcli connection add type ethernet ifname ens20 master bond0

This will add ens18, ens19, and ens20 as member interfaces to the bond0 bond connection.
You can verify the newly created network connections using command:

$ nmcli connection show

Sample Output:

NAME UUID TYPE DEVICE

bond-bond0 e68041f8-d836-4b83-a743-1bcadec9d19e bond bond0

Wired connection 1 60e8eaf3-89f9-3e9f-9919-1944e7abee20 ethernet ens18

bond-slave-ens19 578bb27f-f3ff-4059-bd94-5291b98ce2fb ethernet ens19


bond-slave-ens20 e338b080-6dc6-41b2-bb08-53d0470dccbd ethernet ens20
Wired connection 2 5527636c-50a9-35a4-b92b-adcc4f106cba ethernet --
Wired connection 3 878666ef-2160-338b-aadf-e24e9a52509a ethernet --
5. Configure Bonding Options
You may need to configure additional options depending on your bonding mode and network
setup. For example, if you're using active-backup mode, you can specify the primary
interface:
$ sudo nmcli connection modify bond-bond0 primary ens19

The step of specifying the primary interface is required in some bonding modes, such as
active-backup, to determine which interface should be the primary one that actively carries
network traffic under normal conditions.

This setting is crucial for ensuring that the bonding mode functions as expected and that
traffic is properly distributed or fails over in case of a network failure.

In active-backup mode, for instance, designating the primary interface ensures that network
traffic primarily goes through that interface, and if it becomes unavailable, the backup
interface takes over.

Without specifying the primary interface, the bond may not know which interface to use as
the default choice for sending and receiving traffic.

6. Configure IP Address and DNS Settings


You can set the IP address, subnet mask, gateway, and DNS settings for
the bond0 connection using the nmcli command. For example:

$ sudo nmcli connection modify bond-bond0 [Link] manual

$ sudo nmcli connection modify bond-bond0 [Link] "[Link]/24"

$ sudo nmcli connection modify bond-bond0 [Link] "[Link]"

$ sudo nmcli connection modify bond-bond0 [Link] "[Link], [Link]"

You can also mention all network details in a single command like below:

$ sudo nmcli connection modify bond-bond0 [Link] manual [Link]


"[Link]/24" [Link] "[Link]" [Link] "[Link],[Link]"

7. Activate the Bond Connection


Finally, activate the bond connection using the nmcli command:

$ sudo nmcli connection up bond-bond0


8. Verify the Configuration
Verify that the bonded interface bond0 is up and running using the nmcli command:

$ sudo nmcli connection show

Testing Your Linux Network Bond Interface


To check if the bond interface is working correctly, you can perform various tests and checks
to ensure that it provides the expected redundancy and load balancing.

Here are some steps to help you verify the functionality of a bond interface in Linux:

1. Check Bond Status


Use the following command to check the status of your bond interface (replace bond0 with
the actual name of your bond interface):

$ sudo cat /proc/net/bonding/bond0

This command will display detailed information about the bond interface, including its mode,
the status of the slave interfaces, and any errors or failures.
2. Test Failover
To verify that failover is working as expected, you can physically disconnect one of the slave
interfaces (e.g., unplug the network cable) and monitor the bond's behavior.

The bond should automatically switch traffic to the remaining active slave interface.

sudo cat /proc/net/bonding/bond0

3. Test Load Balancing


If your bond is configured for load balancing (e.g., using the "balance-rr" mode), you can use
tools like iperf to generate network traffic and check if it is distributed evenly across the
bonded interfaces.
Install iperf if it's not already installed and run tests between your server and other network
devices.
Example:
 On the server (bonded interface): iperf -s
 On a client: iperf -c <server_ip>

Verify that traffic is flowing through all bonded interfaces and that you are getting increased
throughput compared to a single interface.
4. Check Interface Status
Use standard network diagnostic tools like ifconfig, ip, or nmcli to check the status of
individual network interfaces (both slave and bond).

$ ip addr show

5. Review System Logs


Check system logs (e.g., /var/log/syslog, /var/log/messages) for any error messages or
notifications related to the bond interface. Look for any messages indicating interface
failures or issues.
6. Monitor Network Traffic
You can use network monitoring tools like tcpdump or wireshark to capture and analyze
network traffic on the bond interface. This can help you confirm that traffic is being balanced
or failover is working as expected.
7. Ping and Test Connectivity
Perform ping tests and test network connectivity between your bonded server and other
devices on the network. Verify that you can reach various destinations, and there are no
connectivity issues.

8. Load Testing
In addition to iperf, you can perform more comprehensive load testing using tools
like netperf or ttcp to evaluate the bond's performance under heavy network loads.

Change IP Address of Bond Interface


To change the IP address of a bond interface in Linux later, you can follow these steps:

Modify Bond Interface IP Address using Netplan


Edit the Netplan Configuration (for systems using Netplan):
If you're using Netplan for network configuration (common in modern Linux distributions),
you'll need to edit the Netplan configuration file. For example, if your bond interface is
configured in a file named [Link], you can edit it with a text editor:

$ sudo nano /etc/netplan/[Link]

2. Modify the IP Address:


In the Netplan configuration file, locate the addresses section under your bond interface
configuration. It will look something like this:

addresses: [[Link]/24]

3. Apply the Configuration:

$ sudo netplan apply

other network configuration methods like NetworkManager or ifupdown, the steps may vary
slightly.
In such cases, you will need to modify the configuration files for the bond interface and then
restart or reload the network service to apply the changes.

Modify Bond Interface IP Address using nmcli


For instance to change the IP address of a bond interface using nmcli command, follow the
steps below.
1. Check Existing Bond Configuration:

$ nmcli connection show bond0


2. Modify the IP Address:

$ sudo nmcli connection modify bond0 [Link] new_ip_address/24

3. Apply the Changes:

$ sudo nmcli connection up bond0

4. Verify the Changes:

$ nmcli connection show bond0

Q: What bonding modes are available in Linux?


A: Linux supports various bonding modes, including "active-backup" (failover), "balance-rr"
(round-robin), "802.3ad" (LACP), and more. Each mode serves different purposes and suits
specific network configurations.

Q: How can I test if my bond interface is working correctly?


A: You can test your bond interface by monitoring its status, simulating network failures to
check failover behavior, and using tools like iperf to verify load balancing.

Q: What should I do if I need to change the IP address of a bond interface?


A: To change the IP address of a bond interface, modify the relevant configuration file (e.g.,
Netplan, ifupdown, NetworkManager), update the IP address, and apply the changes using
the appropriate command or tool (e.g., netplan apply, nmcli connection up).

Q: Can I add or remove slave interfaces from a bond interface without disrupting
network connectivity?
A: Yes, you can dynamically add or remove slave interfaces from a bond interface without
disrupting network connectivity. The bond interface will adapt to the changes, provided it is
configured correctly.

How To Configure Static IP Address In


Ubuntu
1. Identify the Network Interface:
Use the ip a or ip link command to list your network interfaces. Note the name of the
interface you want to configure, e.g., eth0 or ens33.

1. Identify the Network Interface:


Use the ip a or ip link

2. Backup the Current Configuration:


3. $ ls /etc/netplan/
[Link]
$ sudo cp /etc/netplan/[Link] /etc/netplan/01-network-
manager-all_backup.yaml

4. Edit the Configuration:


sudo nano /etc/netplan/[Link]

5. Configure Static IP
6. network:
7. version: 2
8. renderer: networkd
9. ethernets:
10. ens18:
11. dhcp4: no
12. addresses:
13. - [Link]/24
14. gateway4: [Link]
15. nameservers:
16. addresses: [[Link], [Link]]

5. Validate Configuration File:

$ sudo netplan try

6. Apply the Configuration:

$ sudo netplan apply

7. Verify the Changes:


Use ip a or ip addr show dev ens18

Restart the Network Service (Optional):

$ sudo systemctl restart systemd-networkd

Method 2 - Configure Static IP Address using nmcli in Ubuntu


nmcli is a command-line client for NetworkManager,
nmcli is available in Ubuntu Server editions even if they do not have a GUI. Ubuntu Server
often comes with NetworkManager and its command-line interface tool, nmcli, to manage
network configurations.

If it's not present for any reason and you wish to use it, you can install it using the
commands below:

$ sudo apt update

$ sudo apt install network-manager


Steps to Set a Static IP Address using nmcli

List Network Connections:

$ nmcli con show

Sample Output:
NAME UUID TYPE DEVICE
Wired connection 1 60e8eaf3-89f9-3e9f-9919-1944e7abee20 ethernet ens18
2. Modify the Connection:
Use the nmcli con modify command to set the static IP, gateway, and DNS.
Replace YourConnectionName, YourIPAddress, YourGateway, and YourDNS with the appropriate
values:

nmcli con modify YourConnectionName [Link] YourIPAddress/24


nmcli con modify YourConnectionName [Link] YourGateway
nmcli con modify YourConnectionName [Link] YourDNS
nmcli con modify YourConnectionName [Link] manual

$ sudo nmcli con modify 'Wired connection 1' [Link] [Link]/24


$ sudo nmcli con modify 'Wired connection 1' [Link] [Link]
$ sudo nmcli con modify 'Wired connection 1' [Link] "[Link],[Link]"
$ sudo nmcli con modify 'Wired connection 1' [Link] manual

You can also set all details in a single command like below.

$ sudo nmcli connection modify 'Wired connection 1' ip4 [Link]/24 gw4
[Link] [Link] [Link]

3. Restart the Network Connection:


$ sudo nmcli con down 'Wired connection 1'
$ sudo nmcli con up 'Wired connection 1'

4. Verify the Changes:

$ nmcli con show 'Wired connection 1'

If you want to filter out the IP address from the output, use the grep command like below:

$ nmcli con show 'Wired connection 1' | grep [Link]

Similarly, to show the gateway and DNS, run:

$ nmcli con show 'Wired connection 1' | grep [Link]


$ nmcli con show 'Wired connection 1' | grep [Link]
Set Static IP Address using nmtui in Ubuntu

The nmtui is a terminal-based user interface tool that allows you to manage network
configurations on systems using NetworkManager.

1. Install nmtui (if not already installed):

$ sudo apt update


$ sudo apt install network-manager

2. Launch nmtui:
Simply type the command:

$ sudo nmtui

2. Navigate the nmtui menu:

To apply the changes, you might need to restart the NetworkManager service:

$ sudo systemctl restart NetworkManager

Assign a Static IP Address in Ubuntu GNOME Desktop


if you're using the default GNOME desktop environment.
How To Assign Multiple IP Addresses To A Single Network Interface
Card In Linux

sudo nano /etc/netplan/[Link]


network:
version: 2
renderer: networkd
ethernets:
ens18:
dhcp4: no
addresses:
- [Link]/24
- [Link]/24
- [Link]/24
routes:
- to: default
via: [Link]
nameservers:
addresses: [[Link], [Link]]

Before applying any changes, always validate the configuration

$ sudo netplan try

Apply the Configuration:

$ sudo netplan apply

6. Verify the Configuration:

$ ip addr show ens18


Configure Multiple IP Addresses using nmcli Command

$ nmcli connection show

$ sudo nmcli connection modify 'Wired connection 1' +[Link]


"[Link]/24,[Link]/24,[Link]/24"

Apply the Changes:

$ sudo nmcli connection down 'Wired connection 1'

$ sudo nmcli connection up 'Wired connection 1'

Verify the Configuration:

$ nmcli con show 'Wired connection 1'

3. Navigate the nmtui menu:


$ sudo nmtui

4. Restart NetworkManager:

$ sudo systemctl restart NetworkManager

we can find the IP address in Ubuntu using command:

ip addr

In older systems, you can use the following command instead:

$ ifconfig

$ sudo ip addr add [Link]/24 dev enp0s3

4.1. Assign Multiple IP Addresses Permanently


Edit /etc/network/interfaces file:

$ sudo nano /etc/network/interfaces

iface enp0s3 inet static

address [Link]/24

Save and close the file. Run the following command to take effect the saved changes.
$ sudo ifdown enp0s3 && sudo ifup enp0s3

Just run the following command to add an additional IP temporarily.

$ sudo ip addr add [Link]/24 dev enp0s3

To add IP address permanent, just Edit network card configuration file as root user:

# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

IPADDR1="[Link]"

PREFIX1=24

Save and close the file.

Restart network service using command:

# systemctl restart network

Verify the new IP address using command:

# ip addr

Find MAC address in Linux

$ ifconfig | grep HWaddr

Sample output:
enp0s3 Link encap:Ethernet HWaddr 08:xx:xx:xx:xx:x1

$ ip link show

enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state


UP mode DEFAULT group default qlen 1000

link/ether 08:xx:xx:xx:xx:x1 brd ff:ff:ff:ff:ff:ff

$ ifconfig | grep ether

Sample output:
ether 24:xx:xx:xx:xx:x9 txqueuelen 1000 (Ethernet)
ether c0:xx:xx:xx:xx:xf txqueuelen 1000 (Ethernet)
Change MAC address in Linux
Method 1: Using Macchanger
On Fedora, CentOS, RHEL:

$ sudo yum install macchanger

Or

$ sudo dnf install macchanger

On Debian / Ubuntu:

$ sudo apt-get install macchanger

Macchanger usage
To assign any random MAC address, run:

$ macchanger -r <interface-name>

To find out the network interface name, run:

$ ip addr

To change the MAC address of enp0s3 network card, run:

$ sudo macchanger -r enp0s3

Method 2: Using iproute2


First, turn off the Network card using command:

$ sudo ip link set dev enp0s3 down

Next, set the new MAC is using command:

$ sudo ip link set dev enp0s3 address XX:XX:XX:XX:XX:XX

Finally, turn it on back with command:

$ sudo ip link set dev enp0s3 up

Now, verify new MAC id using command:

$ ip link show enp0s3

using 'ifconfig' command

$ sudo ifconfig eth0 down


$ sudo ifconfig eth0 hw ether 00:80:48:BA:d1:30

$ sudo ifconfig eth0 up

$ ifconfig eth0 | grep HWaddr

Identify the Network Interface:


Use the ip a or ip link command to list your network interfaces.
Create or Edit a Netplan Configuration File:

$ sudo nano /etc/netplan/[Link]

Configure the Network Interface:


network:
version: 2
renderer: networkd
ethernets:
ens18:
dhcp4: no
addresses:
- [Link]/24
- [Link]/24
- [Link]/24
routes:
- to: default
via: [Link]
nameservers:
addresses: [[Link], [Link]]

Press CTRL+O followed by CTRL+X to save the file and close it.
Validate Configuration File:

$ sudo netplan try

Apply the Configuration:

$ sudo netplan apply

Verify the Configuration:

$ ip addr show ens18

2. Configure Multiple IP Addresses using nmcli Command


nmcli is a command-line tool for managing NetworkManager, which is commonly used for
network configuration on Linux systems.
List Network Connections:

$ nmcli connection show


Add Additional IP Addresses:

$ sudo nmcli connection modify 'Wired connection 1' +[Link]


"[Link]/24,[Link]/24,[Link]/24"

Apply the Changes:

$ sudo nmcli connection down 'Wired connection 1'

$ sudo nmcli connection up 'Wired connection 1'

Verify the Configuration:

$ nmcli con show 'Wired connection 1'

3. Set Multiple IP Addresses using nmtui Utility


The nmtui is a terminal-based user interface tool that allows you to manage network
configurations on systems using NetworkManager.
1. Install nmtui (if not already installed):
Depending on your Linux installation, nmtui might not be installed by default. You can
install it using the following commands:
2. $ sudo apt update
3. $ sudo apt install network-manager

Simply type the command: $ sudo nmtui


Restart NetworkManager:

$ sudo systemctl restart NetworkManager

4.1. Assign Multiple IP Addresses Permanently


Edit /etc/network/interfaces file:

$ sudo nano /etc/network/interfaces

iface enp0s3 inet static

address [Link]/24

Save and close the file.


Run the following command to take effect the saved changes.

$ sudo ifdown enp0s3 && sudo ifup enp0s3

Verify by $ ip addr
4. Set Multiple IP Addresses to Single Network Interface in
Older RPM-based Systems
just run the following command to add an additional IP temporarily.

$ sudo ip addr add [Link]/24 dev enp0s3

To add IP address permanent, just Edit network card configuration file as root user

# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

IPADDR1="[Link]"

PREFIX1=24

Save and quit

# systemctl restart network

# ip addr ( verify your changes )

7. Assign Different Class IP Addresses in Fedora, RHEL and


CentOS Systems
Edit network card configuration file as root user:

# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

creating bond usinf Netplan , Netplan is a YUML based network configuration utility used in udubtu ,
Netplan are stored in /etc/netplan firectory and have .yuml extension, u can use nano, vim editor,
expmple of the filr will be like ( [Link] )

ip link show
ifconfig
interface name like ethX or ensX or enp0sX
sudo nano /etc/[Link]

network:
version: 2
renderer: networkd
ethernets:
ens18:
dhcp4: no
ens19:
dhcp4: no
ens20:
dhcp4:no
bonds:
bond0:
interfaces: [ens18,ens19,ens20]
addresses: [[Link]/24]
route:
to: [Link]/0
via [Link]
nameserver:
addresses: [[Link], [Link]]
parameters:
mode: active-backup / balance-rr for round robin
primary: ens18

sudo netplan apply

ip link show bond0

================================================================
creating bond using nmcli

ip link show or ifconfig


sudo systemctl status NetworkManager (check NetworkManager is installed and in running status )
sudo systemctl start NetworkManager (Start NetworkManager )
sudo systemctl enable NetworkManager (Enable NetworkManager )

creating a New bond Connection using nmcli


nmcli connection add type bond ifname bond0 mode MODE_NAME
Replace MODE_NAME with active-backup, balance-rr or 802.3ad
example :
sudo nmcli connection add type bond ifname bond0 mode active-backup
above command will create new network connection named " bond-bond0"

now you need to add interface name that you want to be the member bond0
example : i am adding ens19 and ens20 as a memeber of bond0
sudo nmcli connection add type ethernet ifname ens19 master bond0
sudo nmcli connection add type ethernet ifname ens20 master bond0

verify the newly created network connection


nmcli connection show

we specify ens19 is primary and this will active but other ens20 will work standby failover if ens19 will
down then only ens20 become active. this configuration use only in active-backup mode. need to tell
which will be active enterface.

sudo nmcli connection modify bond-bond0 primary ens19


assigning ip address to bond interface
sudo nmcli connection modify bond-bond0 [Link] manual
sudo nmcli connection modify bond-bond0 [Link] " [Link]/24"
sudo nmcli connection modify bond-bond0 [Link] " [Link]"
sudo nmcli connection modify bond-bond0 [Link] " [Link], [Link]"
or
sudo nmcli connection modify bond-bond0 [Link] manual [Link] "[Link]/24"
[Link] "[Link] [Link] "[Link],[Link]"

finally activate the bond connection


sudo nmcli connection up bond.bond0

verify the connection


sudo nmcli connection show

check bond status ( this will tell all info. of bond interface like mode, status, slave, any error)

sudo cat /proc/net/bonding/bond0

test failover

unplug one of the slave and check how to switch to the other slave

==============================================================
scp -r root@[Link]:/MsOffice2016-2019-2021_v16.[Link] root@[Link]:/

You might also like