Network Bridges in Legacy and Hybrid Networks Explained
What network bridges do in legacy and hybrid networks: MAC learning, Linux bridges for KVM and Docker, STP, VLAN filtering, VXLAN and migration steps.
A network bridge joins two or more Ethernet segments at Layer 2 and forwards frames by MAC address, so devices on both sides behave as if they share one LAN. In legacy and hybrid setups, bridges keep old segments, virtual machines, containers and overlay tunnels talking to modern networks without readdressing anything.
Most physical networks replaced standalone two-port bridges with switches long ago, and our comparison of routers, switches, hubs and bridges covers that history. This guide looks at where bridging still does real work today: inside every Linux host that runs KVM or Docker, at the edge where an old flat network meets a newer routed one, and in hybrid designs where a Layer 2 segment has to stretch across a tunnel.
Key takeaways
- A bridge learns which MAC addresses sit behind which port and forwards frames only where they need to go, splitting collision domains while keeping one broadcast domain.
- A switch is a multiport bridge. The logic is the same; the difference is port count and hardware forwarding.
- The Linux kernel ships a software bridge that hypervisors and container runtimes use to connect virtual NICs to the physical network.
- Spanning tree is off by default on a Linux bridge and so is VLAN filtering. Turn them on deliberately when the topology needs them.
- In hybrid networks, bridges are often paired with VXLAN tunnels to carry Layer 2 traffic over a routed Layer 3 network.
- Bridging is a migration tool. Long term, most designs move to routed segments with smaller broadcast domains.
What a bridge actually does
A bridge listens to every frame that arrives on its ports. It reads the source MAC address and records it in a forwarding database (FDB) together with the port it came in on. When a frame arrives for a destination it already knows, the bridge sends it out of that one port. When the destination is unknown, or the frame is a broadcast, the bridge floods it out of every port except the one it arrived on.
That simple loop has three effects that matter in older networks:
- Traffic between two hosts on the same side of the bridge never crosses to the other side, so each segment carries less load.
- Each port is its own collision domain, which mattered a great deal on shared coaxial and hub-based Ethernet.
- Broadcasts still reach every port, so the whole bridged network remains one broadcast domain and one IP subnet.
The Linux kernel documentation describes its bridge as transparently forwarding traffic between interfaces using only Layer 2 information. Because forwarding ignores the IP layer, a bridge carries IPv4, IPv6 and older non-IP protocols equally well. That protocol independence is exactly why bridges survived in legacy environments that still run non-IP equipment.
Bridge vs switch vs router
| Device | Layer | Forwards by | Broadcast domain | Typical use today |
|---|---|---|---|---|
| Bridge | 2 | MAC address | Shared across all ports | Software bridges in hypervisors and containers, wireless bridges, segment joins during migration |
| Switch | 2 (some also 3) | MAC address in hardware | Shared, unless split by VLANs | Access and distribution layers of every LAN |
| Router | 3 | IP address | Separate per interface | Joining subnets, internet edge, cloud gateways |
If you want the layer model behind this table, our guide on how Layer 2 and Layer 3 devices differ walks through it with examples.
Where bridges still appear in legacy networks
Joining old segments without readdressing
Older sites often have equipment with hard-coded IP addresses, embedded controllers that nobody can reconfigure, or applications that rely on broadcasts to find peers. Splitting that network with a router would mean new subnets and new addresses. A bridge lets you connect a new segment, such as a fresh cabling run or a new building, to the old one while every device keeps its address and still sees the broadcasts it depends on.
Isolating noisy segments
On networks that still contain hubs, a single busy host can saturate a shared segment. Putting a bridge, or more commonly a switch, between the busy segment and the rest stops local traffic from leaking across. The broadcast load stays the same, though, so this helps with unicast congestion only.
Wireless point-to-point links
When two buildings need to share one LAN and running fibre between them is not practical, a pair of wireless bridges carries Ethernet frames across the gap. To the hosts on either side it looks like one cable.
Media conversion
Some legacy kit only has older physical interfaces. A bridging device with mixed port types can connect it to a modern switch while keeping it in the same Layer 2 network.
Where bridges appear in hybrid and virtual networks
For DevOps and cloud engineers, the most common bridge is not a box in a rack. It is a software interface inside a Linux host.
Hypervisors
On a KVM host, each virtual machine gets a virtual NIC. To put those VMs on the same LAN as the physical network, administrators create a bridge, attach the host's physical interface to it, and attach the VM interfaces to the same bridge. The VMs then get addresses from the normal network DHCP server and appear as ordinary hosts. Our article comparing KVM, VirtualBox and VMware explains the hypervisor side of this setup.
Containers
When the Docker daemon starts, it creates a default network called bridge, and new containers join it unless you specify another network. Containers on that bridge talk to each other directly, and Docker uses masquerading to give them access to external networks, so outside devices see only the host's IP address. Commands for inspecting this are in our list of Docker networking commands.
Overlay networks
Hybrid designs sometimes need one Layer 2 segment to span two sites, or an on-premises rack and a cloud environment, over a routed path. VXLAN encapsulates Ethernet frames inside UDP packets. A VXLAN interface attached to a Linux bridge lets local ports and remote tunnel endpoints share the same bridged segment. This is how many overlay networks in virtualisation platforms and Kubernetes network plugins work under the hood.
Building a Linux bridge, step by step
The commands below use the iproute2 tools documented in the ip-link(8) and bridge(8) manual pages. Run them on a lab VM, not over the SSH session that uses the interface you are about to move, because enslaving an interface to a bridge removes its IP configuration until you move that configuration to the bridge.
# Create the bridge
sudo ip link add name br0 type bridge
# Attach a physical or virtual interface to it
sudo ip link set dev eth1 master br0
# Bring both up
sudo ip link set dev eth1 up
sudo ip link set dev br0 up
# Put the host's address on the bridge, not on eth1
sudo ip addr add 192.0.2.20/24 dev br0
# List ports that belong to br0
ip link show master br0
bridge link show master br0
To see what the bridge has learned, read its forwarding database:
bridge fdb show br br0
Each line shows a MAC address, the port it was learned on and, with VLAN filtering on, the VLAN. If a host cannot be reached, checking whether its MAC appears here tells you whether the problem is at Layer 2 or above it.
Commands typed with ip do not survive a reboot. On RHEL and Fedora, NetworkManager stores bridges permanently; on Ubuntu servers, Netplan does. Make the bridge persistent with the tool your distribution uses, and test the change from a console session rather than SSH.
Turning on spanning tree
Two bridged paths between the same segments create a loop, and Ethernet has no time-to-live field, so broadcasts circulate until the network saturates. Spanning tree breaks loops by putting redundant ports into a blocking state. The Linux kernel documentation notes that STP is off by default on a Linux bridge, and that IEEE 802.1D-2004 replaced the original protocol with the Rapid Spanning Tree Protocol.
sudo ip link set dev br0 type bridge stp_state 1
Leave STP off on a bridge that has only one uplink and a set of VM or container ports, because those topologies cannot loop. Turn it on whenever a bridge has two paths toward the physical network, or when you bridge two segments that already connect elsewhere.
VLAN filtering
A plain bridge forwards every frame regardless of its 802.1Q tag. With VLAN filtering on, the bridge forwards a frame only when the destination MAC and the VLAN both match, which lets one bridge carry several isolated VLANs. The kernel documentation states that VLAN filtering is disabled by default and supports both 802.1Q and 802.1ad tagging.
sudo ip link set dev br0 type bridge vlan_filtering 1
sudo bridge vlan add dev eth1 vid 20
sudo bridge vlan add dev vnet0 vid 20 pvid untagged
bridge vlan show
Here eth1 carries VLAN 20 tagged toward the physical switch, while the VM interface vnet0 receives that VLAN untagged. Our guide on VLANs and subnets explains how each VLAN maps to its own IP subnet.
Adding a VXLAN port
sudo ip link add vxlan42 type vxlan id 42 dev eth0 remote 198.51.100.10 dstport 4789
sudo ip link set dev vxlan42 master br0
sudo ip link set dev vxlan42 up
This creates a tunnel with VXLAN network identifier 42 toward one remote endpoint and attaches it to br0. Frames that the bridge sends to the VXLAN port are wrapped in UDP and routed to the far end, where a matching bridge unwraps them. Keep the reduced MTU in mind: encapsulation adds headers, so either raise the MTU on the underlay or lower it on the bridged interfaces.
Firewalling bridged traffic
Bridged frames do not pass through the IP routing path, so plain iptables rules on the host do not see them by default. The legacy br_netfilter module changes that, but the kernel documentation says it is scheduled for removal and is not available in user namespaces, and that ebtables and nftables work without it. For new builds, write Layer 2 filtering rules with nftables in the bridge family instead of depending on br_netfilter. Be aware that some existing tools, including older Kubernetes setups, still load it, so check before you remove it from a host.
Common problems in bridged legacy networks
| Symptom | Likely cause | What to check |
|---|---|---|
| Network slows to a halt, switch port LEDs flash constantly | Bridging loop with STP off | Look for a second path between segments; enable STP or remove the duplicate link |
| Host loses connectivity after creating a bridge | IP address still on the enslaved interface | Move the address and default route from eth1 to br0 |
| VM can reach the host but not the LAN | Upstream switch port limits MAC addresses, or VLAN mismatch | Check port security on the physical switch and run bridge vlan show |
| Large transfers stall over a VXLAN link while pings work | MTU too large for the encapsulated path | Test with ping -M do -s at decreasing sizes and adjust MTU |
| Intermittent reachability for one host | Same MAC learned on two ports, or a stale FDB entry | Run bridge fdb show and look for the MAC moving between ports |
Planning the move away from a flat bridged network
Bridges are good at keeping old networks working during a change. They are less good as a permanent design for a large site, because every bridged port shares one broadcast domain and one failure domain. A practical migration usually follows these steps:
- Inventory the devices on the flat network and note any that need broadcasts or fixed addresses.
- Introduce VLAN-capable switches and keep everything in one VLAN at first, so nothing changes from the hosts' point of view.
- Create new VLANs and subnets for new equipment, with a router or Layer 3 switch between them.
- Move flexible devices into the new subnets group by group, and keep the legacy group on its original bridged VLAN.
- For the legacy devices that cannot move, keep a small bridged segment and control what reaches it with firewall rules.
In virtualised and cloud environments, the same idea applies. Use Linux bridges for the short hop between a host and its guests, and route between sites and environments instead of stretching Layer 2 everywhere.
Skills to practise
To get comfortable with bridging, build a two-VM lab: create a bridge on the host, attach both VMs, capture traffic with tcpdump -i br0 -e to see MAC headers, then add a VLAN and a VXLAN link to a third machine. Watching the FDB fill as hosts talk teaches more than any diagram. These Linux networking tasks are part of our Linux administration training, available in the Kharadi, Pune classroom and live online across India.
For the protocol background, read what the OSI model is and why it still matters, then come back to this guide and map each command to the layer it touches.
Frequently asked questions
What is the role of a bridge in a legacy network?
It connects older Ethernet segments at Layer 2 so devices keep their IP addresses and broadcast behaviour, while traffic between hosts on the same segment stays local. That lets you extend or split an old network without readdressing.
Is a bridge the same as a switch?
A switch is a multiport bridge that forwards in hardware. Both learn MAC addresses and forward frames at Layer 2; the difference is scale and speed.
Does a bridge separate broadcast domains?
No. A bridge splits collision domains, but broadcasts reach every port. Use VLANs or a router to split broadcast domains.
Why do KVM and Docker use bridges?
A bridge lets virtual NICs share a Layer 2 network with each other and with the host. KVM often bridges VMs onto the physical LAN; Docker's default bridge network connects containers to each other and masquerades their outbound traffic behind the host address.
Is spanning tree enabled on a Linux bridge by default?
No. The Linux kernel documentation states STP is off by default. Enable it with ip link set dev br0 type bridge stp_state 1 when the topology can form a loop.
How do I see which MAC addresses a Linux bridge has learned?
Run bridge fdb show br br0. It lists each learned MAC address and the port it sits behind.
How do bridges help in hybrid cloud networks?
Combined with VXLAN, a Linux bridge can extend one Layer 2 segment across a routed network, which helps during migrations. For long-term designs, routing between sites is usually simpler and safer.
Do I still need br_netfilter to firewall bridged traffic?
Only if you rely on iptables to filter bridged frames. The kernel documentation says br_netfilter is scheduled for removal and that nftables works without it, so prefer nftables bridge-family rules for new setups.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0