ubuntu multiple network interfaces

Master Ubuntu Multiple Network Interfaces: Optimize Routing & Connectivity

By Richard King
AD

In a complex server or high-performance computing environment, the need for multiple network connections is common. Ubuntu, renowned for its robustness and flexibility, handles this scenario with a powerful networking framework that allows administrators to bond, bridge, or simply manage multiple interfaces independently. Configuring multiple network interfaces on Ubuntu is essential for separating traffic, achieving load balancing, or establishing redundant pathways to ensure maximum uptime.

Understanding the Ubuntu Networking Stack

Before diving into configuration, it is vital to understand how Ubuntu manages network interfaces. Traditionally, the system used ifupdown, relying on /etc/network/interfaces. Modern Ubuntu deployments, especially those using netplan, have shifted towards a more declarative and YAML-driven approach. Netplan serves as a front-end that generates the configurations for NetworkManager or systemd-networkd, providing a consistent experience whether you are managing a headless server or a desktop environment.

Identifying Your Network Interfaces

The first step in managing multiple interfaces is identifying them correctly. Hardware interfaces are usually named predictably, starting with en, followed by a string of characters (e.g., enp0s3, enp1s0). You can list all available interfaces using the ip link command or ls /sys/class/net. This step is critical because the names are used in all subsequent configuration files to direct traffic to the correct physical or virtual adapter.

AD
What Ubuntu Unity Fans Can Do to Keep Your Favorite Interface
What Ubuntu Unity Fans Can Do to Keep Your Favorite Interface
Restarting the Network on Ubuntu
Restarting the Network on Ubuntu
an image of a computer screen with the tv guide button highlighted
an image of a computer screen with the tv guide button highlighted

Configuring Interfaces with Netplan

Netplan configurations are stored in /etc/netplan/ and are written in YAML. This format ensures that the configuration is both human-readable and machine-parsable. When defining multiple interfaces, you assign a match rule to identify the hardware and then specify static or dynamic (DHCP) addresses, gateways, and DNS servers. The order of the definitions matters, as it dictates the naming and activation sequence during the boot process.

Example Netplan Configuration

Below is a basic example demonstrating how to assign static IPs to two interfaces. The first interface, enp0s3, is configured for external access with a public gateway. The second interface, enp1s0, is reserved for internal communication on a private subnet without a gateway, ensuring traffic isolation.

Configuring IP Networking with nmtui on Linux
Configuring IP Networking with nmtui on Linux
22 Best Ubuntu Themes and Icons That Will Blow Your Mind
22 Best Ubuntu Themes and Icons That Will Blow Your Mind
How to install Webmin on Ubuntu
How to install Webmin on Ubuntu
Network Configuration Details
File /etc/netplan/01-netcfg.yaml
Interface 1 enp0s3 (DHCP)
Interface 2 enp1s0 (Static 192.168.10.1/24)
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: true
    enp1s0:
      addresses:
        - 192.168.10.1/24

Advanced Routing and Policy-Based Routing

Simply adding multiple interfaces is often not enough; you need to control how traffic flows between them. Ubuntu leverages the Linux kernel's routing table to allow for policy-based routing. This means you can direct specific types of traffic—such as traffic to a particular subnet—out a specific interface, regardless of the default route. This is achieved by adding additional tables to /etc/iproute2/rt_tables and creating rules that match on source address or destination address.

Bonding for Redundancy and Throughput

For scenarios requiring high availability or increased bandwidth, bonding is the go-to solution. Ubuntu supports various bonding modes, such as balance-rr (round-robin) for load balancing and active-backup for fault tolerance. By creating a bond interface (e.g., bond0) and attaching slave interfaces to it, the operating system aggregates the links. The configuration is handled within Netplan, where you specify the mode and the participating interfaces, effectively turning multiple connections into a single logical path.

AD
network:
  version: 2
  renderer: networkd
  bonds:
    bond0:
      addresses:
        - 192.168.1.100/24
      gateway4: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100

Troubleshooting and Verification

After applying the configuration, verify the status using ip addr show to ensure the IPs are assigned correctly. You can check the routing table with ip route to confirm that specific rules are directing traffic as intended. If an interface fails to come up, inspecting the logs with journalctl -u systemd-networkd or checking the physical connections is the next step. Properly configured multiple interfaces should provide resilience and performance that a single adapter cannot match.

an image of a penguin and penguins with the word ubuntu on it
an image of a penguin and penguins with the word ubuntu on it
Linux Network Bonding: Combine Network Interfaces
Linux Network Bonding: Combine Network Interfaces
Setting up NFS shares on Ubuntu
Setting up NFS shares on Ubuntu
Network Basics for Linux Admins (IP, DNS, Routing & Firewall Guide) #LinuxTeck
Network Basics for Linux Admins (IP, DNS, Routing & Firewall Guide) #LinuxTeck
ubuntu linux
ubuntu linux
10 New Linux Ubuntu 19.04 Features and How to Use Them
10 New Linux Ubuntu 19.04 Features and How to Use Them
IP network emulator / simulator
IP network emulator / simulator
Configuring IP Networking with nmtui on Linux
Configuring IP Networking with nmtui on Linux
the music player is running in windows xp and mac osm file formats are available
the music player is running in windows xp and mac osm file formats are available
four different types of network routing
four different types of network routing
This Infographic Reveals the Scale of Ubuntu's Success - OMG! Ubuntu
This Infographic Reveals the Scale of Ubuntu's Success - OMG! Ubuntu
40 Basic Ubuntu Commands And Terminal Shortcuts For Beginners
40 Basic Ubuntu Commands And Terminal Shortcuts For Beginners
34 Must-Have Ubuntu Apps in 2020
34 Must-Have Ubuntu Apps in 2020
How to find files on Ubuntu
How to find files on Ubuntu
Running Tailscale on Ubuntu
Running Tailscale on Ubuntu
the linux file managers wheel is shown with icons in different colors and font on it
the linux file managers wheel is shown with icons in different colors and font on it
How to Install Vimix GTK Theme on Ubuntu with Screenshots (2026)
How to Install Vimix GTK Theme on Ubuntu with Screenshots (2026)
How to Install Ubuntu Touch on Your Mobile Phone
How to Install Ubuntu Touch on Your Mobile Phone
Ya disponible la primera Daily Build de Ubuntu 25.10 Questing Quokka
Ya disponible la primera Daily Build de Ubuntu 25.10 Questing Quokka
How to Install Unity 8 and Mir on Linux Ubuntu Right Now
How to Install Unity 8 and Mir on Linux Ubuntu Right Now
AD