High Availability at the Physical Layer
If your enterprise database server relies on a single Ethernet cable, you have a critical single point of failure. If that cable is unplugged, or the switch port dies, your server goes offline instantly. Network Bonding (often called NIC Teaming in Windows or Link Aggregation) solves this by bundling two or more physical network interface cards (NICs) into a single logical interface. They share a single IP address. If one cable fails, traffic instantly fails over to the second cable with zero interruption. Additionally, depending on the mode, bonding can aggregate the bandwidth (turning two 1Gbps ports into a 2Gbps pipeline).
Step 1: Identify Your Network Interfaces
First, physically plug two Ethernet cables from the server into your switch. Open your terminal and identify their logical names in Ubuntu:
ip link
Note the names of the two interfaces you wish to bond (e.g., eno1 and eno2).
Step 2: Understand the Bonding Modes
The Linux kernel supports several bonding modes. The two most common are:
- Mode 1 (Active-Backup): One NIC handles all traffic. If it fails, the second NIC takes over. This requires zero configuration on the network switch.
- Mode 4 (802.3ad / LACP): Both NICs are active simultaneously, providing combined bandwidth and fault tolerance. This requires you to log into your managed network switch and explicitly configure those two ports as an LACP LAG (Link Aggregation Group).
For maximum compatibility without touching the switch, we will configure Mode 1 (Active-Backup).
Step 3: Configure Netplan
Modern Ubuntu Server utilizes netplan for network configuration. Open the default configuration file (the filename may vary slightly):
sudo nano /etc/netplan/00-installer-config.yaml
Step 4: Define the Bond Interface
Delete the existing IP configurations for the individual NICs. You must strip them bare and assign the IP address entirely to a new logical bonds interface (which we will name bond0).
Modify the YAML file exactly like this (YAML is strictly indentation-sensitive; use spaces, not tabs):
network:
version: 2
ethernets:
eno1:
dhcp4: no
eno2:
dhcp4: no
bonds:
bond0:
interfaces: [eno1, eno2]
addresses: [192.168.1.50/24]
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
parameters:
mode: active-backup
primary: eno1
mii-monitor-interval: 100
The mii-monitor-interval: 100 tells the kernel to check the link status of the cables every 100 milliseconds to ensure rapid failover.
Step 5: Apply and Verify the Bond
Save the file and test the configuration before applying it permanently:
sudo netplan try
If you don’t lose your SSH connection, press Enter to confirm. Otherwise, run sudo netplan apply.
To verify the bond is active and healthy, query the kernel module directly:
cat /proc/net/bonding/bond0
The output will display the Bonding Mode (fault-tolerance), the Currently Active Slave (eno1), and the “MII Status” (up) for both physical interfaces. Your server is now physically resilient against network hardware failures.