How to Use `nmcli` to Create NIC Bonding
How to Use nmcli
to Create NIC Bonding
Table of Contents
- Introduction
- Step 1: Check Existing Network Interfaces π₯οΈ
- Step 2: Create the Bond Interface π
- Step 3: Add Slaves to the Bond Interface β
- Step 4: Configure IP Settings π
- Step 5: Bring Up the Bonded Interface π
- Step 6: Verify Your Setup β
- Conclusion π―
1. Introduction
Network bonding (or NIC bonding) combines multiple network interfaces into one logical interface to improve redundancy and throughput. Letβs use nmcli
to create NIC bonding on a Linux system! π
2. Step 1: Check Existing Network Interfaces π₯οΈ
First, list all your network interfaces:
π Identify the interfaces you want to bond (e.g., eth0
, eth1
).
3. Step 2: Create the Bond Interface π
Create the bond interface using nmcli
:
Explanation:
con-name bond0
: Name of the bonded connection.ifname bond0
: Name of the bonded interface.mode active-backup
: Bonding mode. You can choose modes likebalance-rr
,802.3ad
, etc.
4. Step 3: Add Slaves to the Bond Interface β
Add the identified interfaces as slaves to the bond:
nmcli connection add type ethernet con-name slave-eth0 ifname eth0 master bond0
nmcli connection add type ethernet con-name slave-eth1 ifname eth1 master bond0
π This attaches eth0
and eth1
as slaves to the bond0
interface.
5. Step 4: Configure IP Settings π
Assign an IP address to the bond:
nmcli connection modify bond0 ipv4.addresses 192.168.1.100/24
nmcli connection modify bond0 ipv4.method manual
nmcli connection up bond0
Replace 192.168.1.100/24
with the correct IP and subnet for your network.
6. Step 5: Bring Up the Bonded Interface π
Activate the bond and its slaves:
π Your bonded interface is now active!
7. Step 6: Verify Your Setup β
Check if everything is working correctly:
You can also check the bonding details:
8. Conclusion π―
Youβve successfully created NIC bonding using nmcli
! Your setup should now provide better network resilience and potentially increased throughput.