Table of Contents
Linux networking becomes much easier to reason about when you treat interfaces as layers. A physical NIC can become part of a bond. A VLAN interface can sit on top of that bond. A bridge can sit on top of the VLAN. The host’s IP address belongs on whichever layer represents the host on that network.
This post focuses on three building blocks that often appear together on servers, virtualization hosts, routers, and lab machines:
- VLANs separate Layer 2 networks while sharing the same physical links.
- Bonding combines multiple NICs into one logical interface for failover or link aggregation.
- Bridging creates a software switch, most commonly to connect VMs or containers to an existing Layer 2 network.
The goal is not to memorize every command. It is to understand where each feature fits, how to stack them safely, and how to verify the result.
The Mental Model
Think from the bottom up:
- Physical NICs:
eno1,eno2,eth0, or similar names represent real network ports. - Bond:
bond0turns multiple physical NICs into one logical uplink. - VLAN interfaces:
bond0.10oreth0.10represents traffic tagged with VLAN ID 10. - Bridge:
br10forwards Ethernet frames between bridge ports, such as a VLAN interface and VM tap devices. - IP configuration: The host’s address goes on the interface where the host participates in the network.
A common virtualization host might look like this:
| |
That layering is the most important idea in the whole post. Most broken Linux network setups come from putting the IP address on the wrong layer, creating a bridge loop, or mismatching the Linux configuration with the switch configuration.
When to Use Each Feature
Use a VLAN when one physical link must carry more than one logical network. For example, a server can receive management traffic on VLAN 10, storage traffic on VLAN 20, and guest traffic on VLAN 30 through the same switch port.
Use a bond when the host needs a resilient uplink or aggregate capacity across multiple flows. For simple redundancy, active-backup is usually the safest mode. For standards-based link aggregation, use 802.3ad LACP and configure the switch ports in the same LACP port channel.
Use a bridge when something else needs to share a Layer 2 network through the Linux host. The most common examples are KVM virtual machines, containers, network namespaces, and lab routers.
Do not use a bridge as a replacement for bonding. If two physical NICs connect to the same Layer 2 network, adding both directly to a bridge can create a loop. Bond the NICs first, then bridge on top of the bond or VLAN.
VLANs
A VLAN is an IEEE 802.1Q tag added to Ethernet frames. Switches use the VLAN ID to keep Layer 2 networks separate while still carrying them across shared links.
Before creating VLAN interfaces in Linux, check the switch:
- A host that carries multiple VLANs usually connects to a trunk/tagged switch port.
- A host that belongs to exactly one VLAN usually connects to an access/untagged switch port and does not need a VLAN subinterface.
- The allowed VLAN list and native VLAN on the switch must match the host design.
Modern Linux systems should use iproute2, NetworkManager, netplan, or systemd-networkd. The older vconfig tool is deprecated.
Temporary VLAN Example
This creates VLAN 10 on eth0 and assigns an address to it. It is useful for testing, but it will not survive a reboot.
| |
Verify it:
| |
Remove it:
| |
Persistent VLAN with NetworkManager
For a static address:
| |
For DHCP:
| |
Bonding
Bonding makes multiple physical NICs behave like one logical interface. The right mode depends on your goal and your switch.
The modes worth knowing first are:
active-backup: One NIC is active and another waits as backup. It is simple and does not require switch-side link aggregation.802.3ad: Uses LACP for dynamic link aggregation. It requires matching switch configuration.balance-xor: Uses a transmit hash to pick a link. It can be useful in controlled environments but needs switch support.balance-tlbandbalance-alb: Provide adaptive load balancing without switch aggregation, but can be harder to reason about operationally.
For most production servers, choose active-backup when you mainly want failover. Choose 802.3ad when you control both ends and want LACP.
Important caveats:
- LACP will not work correctly unless the switch ports are in the same LACP group.
- A single TCP connection usually cannot exceed the speed of one member link. LACP spreads multiple flows, not one flow.
- Put IP addresses on
bond0, a VLAN on top ofbond0, or a bridge on top of that VLAN. Do not put IP addresses on the slave NICs. - Use link monitoring.
miimon=100is a common starting point.
Temporary Bond Example
This creates an active-backup bond from eth0 and eth1:
| |
Check the bond:
| |
Persistent Bond with NetworkManager
This creates a persistent active-backup bond:
| |
For LACP, configure the switch first, then use 802.3ad:
| |
Bridging
A Linux bridge is a software Layer 2 switch. It learns MAC addresses and forwards Ethernet frames between ports. This is why bridges are so useful for virtualization: a VM’s virtual NIC can connect to the same Layer 2 network as a physical NIC.
The key rules are:
- If
eth0is a bridge port, the host IP address should move frometh0to the bridge, such asbr0. - A bridge forwards frames; it does not route between IP networks.
- Avoid adding multiple physical uplinks to the same bridge unless you are deliberately using STP/RSTP and understand the topology.
- For redundant uplinks, bond first and bridge on top of the bond.
The old brctl command from bridge-utils still exists on some systems, but ip and bridge from iproute2 are the modern tools.
Temporary Bridge Example
This creates br0, attaches eth0, and moves the host IP address to the bridge:
| |
Verify it:
| |
Remove it:
| |
Persistent Bridge with NetworkManager
For a host bridge with a static address:
| |
For a DHCP bridge:
| |
A Practical Server Design
Now combine the pieces into a useful server layout.
Assume this design:
eno1andeno2connect to the same switch or MLAG pair.- The switch ports are configured as one LACP port channel.
- The port channel is a VLAN trunk carrying VLAN 10 and VLAN 20.
- VLAN 10 is the host management network:
192.168.10.10/24. - VLAN 20 is a VM network with no host IP address.
- VMs should attach to Linux bridges named
br10andbr20.
Adjust the interface names, VLAN IDs, addresses, DNS servers, and gateway for your own network before applying it.
The layer order should be:
| |
On Ubuntu Server with netplan and systemd-networkd, that can look like this:
| |
Apply it carefully:
| |
Use netplan try when working over SSH. It can roll back if the new network configuration breaks connectivity.
Verification Workflow
After applying a design like this, verify each layer from bottom to top.
Check physical link state:
| |
Check bond status:
| |
You should see the expected bonding mode, active slaves, link status, and LACP details if using 802.3ad.
Check VLAN interfaces:
| |
Check bridge ports:
| |
Check IP and routing:
| |
Check traffic on the wire when something does not work:
| |
If you see no VLAN-tagged traffic on bond0, inspect the switch trunk. If you see tagged traffic on bond0 but nothing on bond0.10, inspect the VLAN ID and interface naming. If the host can reach the gateway but VMs cannot, inspect the bridge and VM tap interfaces.
Common Mistakes
- Putting the IP address on a bridge port: If
eth0orbond0.10is enslaved to a bridge, put the IP address on the bridge. - Creating a bridge loop: Do not put two physical NICs into the same bridge as redundant uplinks. Use a bond, or design STP/RSTP intentionally.
- Expecting LACP to multiply one download: LACP distributes flows. One flow normally uses one member link.
- Forgetting the switch: VLAN trunks, allowed VLANs, native VLANs, and LACP groups must match the Linux host.
- Mixing network managers: Avoid configuring the same interface in NetworkManager, netplan, systemd-networkd, and old ifupdown files at the same time.
- Testing only after persistence: Build temporary configs to understand behavior, but use your distribution’s persistent network system for production.
Tooling Notes
Use iproute2 for inspection and temporary changes. The useful commands are ip link, ip -d link, ip addr, ip route, and bridge.
Use NetworkManager when it is the active network manager on your distribution. nmcli is scriptable and works well on RHEL-family systems, Fedora, many desktops, and some servers.
Use netplan on Ubuntu systems where netplan owns network configuration. Netplan then renders to either NetworkManager or systemd-networkd.
Use systemd-networkd directly on minimal servers if your distribution is built around it.
Avoid new production documentation based on ifconfig, route, vconfig, or brctl. They are useful to recognize on old systems, but they are not the modern interface for Linux networking.
Further Reading
- Linux kernel networking documentation
- Linux bonding driver documentation
- NetworkManager documentation
- Netplan documentation
- systemd-networkd documentation
- Red Hat networking documentation
Conclusion
VLANs, bonds, and bridges are most useful when you combine them deliberately. VLANs define which Layer 2 network traffic belongs to. Bonds define how physical uplinks behave as one logical link. Bridges define which Layer 2 ports can talk to each other.
If you remember the layering order, you can build complex Linux network setups without guessing: physical NICs at the bottom, bonds above them, VLANs above the uplink, bridges above VLANs when VMs or containers need Layer 2 access, and IP addresses on the interface where the host actually participates in the network.