Why Linux Bridges Deserve Your Debugging Attention
Every time a Docker container talks to another container, or a Proxmox VM sends a packet to the gateway, that traffic flows through a Linux bridge. Docker’s default bridge network uses docker0. Every user-defined Docker bridge is a Linux bridge. Every Proxmox virtual bridge — vmbr0, vmbr1, etc. — is the same kernel primitive under the hood.
When something breaks — container can’t reach the internet, VM on a VLAN can’t ping its gateway, or traffic simply vanishes between two bridged interfaces — the problem is almost always in the bridge forwarding table, a missing VLAN tag, or iptables interference.
This guide covers the exact commands and techniques to find and fix those problems. You’ll use brctl, bridge (the modern iproute2 tool), tcpdump, and Docker namespace inspection to trace traffic from container to wire.
Inspecting Linux Bridges with brctl and bridge
Start with the big picture. The bridge-utils package (brctl) is still widely available, but the iproute2 bridge tool is the modern replacement and should be your default.
List All Bridges
|
|
brctl show prints bridge name, bridge ID, STP status, and interfaces. The bridge command with no arguments shows all bridge ports with their state and flags.
Inspect the MAC Forwarding Table
The forwarding database (FDB) is where bridges learn which MAC addresses are on which port. A stale or missing entry is the most common cause of mysterious packet loss.
|
|
Look for entries where ageing timer keeps resetting — that indicates MAC flapping (the same MAC appearing on different ports), usually caused by a network loop or misconfigured bonding.
Check VLAN Membership
If you use VLAN filtering on your bridges (common on Proxmox in VLAN-aware mode), verify which VLANs are allowed on each port:
|
|
A missing VLAN on the port means traffic tagged with that VLAN gets dropped silently — one of the hardest issues to diagnose without this command.
Disable STP on Docker Bridge Networks
Docker user-defined bridges have STP enabled by default on some distributions. This can block ports for 15–30 seconds during container restarts, causing connection timeouts:
|
|
Packet Capture on Bridge Interfaces with tcpdump
Capturing on the bridge interface itself shows all traffic flowing through it, including inter-container traffic that never touches a physical NIC.
Basic Capture on the Bridge
|
|
The -e flag is critical — it prints MAC source and destination addresses so you can verify the bridge is forwarding to the correct port.
Debug: Container Can’t Reach the Internet
A container that can ping its gateway’s IP but not the internet usually points to NAT or routing — but let’s verify at layer 2 first:
|
|
If you see the ICMP request on docker0 but no reply, the bridge is forwarding correctly — the issue is upstream (NAT iptables rule, routing table, or ISP). If you see nothing, the packet isn’t reaching the bridge — check container routes and default gateway.
Docker Network Namespace Inspection
Every Docker container lives in its own network namespace. To bridge traffic, Docker creates a veth pair — one end inside the container’s namespace, the other plugged into the bridge.
Find a Container’s Network Namespace
|
|
This is far more revealing than docker exec. You see exactly what the container sees: its ARP cache, its routing table, its firewall rules.
Debug: Container Resolves DNS But Cannot Connect
This classic symptom — ping google.com resolves but connection fails — is almost never a bridge problem, but here’s how to confirm:
|
|
If the default route points to the bridge IP correctly, the issue is upstream (NAT/firewall). If there’s no default route, restart the container or attach it to the correct network.
Map Container veth to Bridge Port
Each container gets a veth interface in the host namespace. Find which one belongs to your container:
|
|
Then inspect that specific veth on the bridge:
|
|
Proxmox Bridge and VLAN Troubleshooting
Proxmox bridges follow the same Linux bridge rules, but with configuration in /etc/network/interfaces and a VLAN-aware mode that adds another layer.
Check Current Bridge Configuration
|
|
A typical Proxmox bridge with VLAN-aware mode:
auto vmbr0
iface vmbr0 inet static
address 10.0.20.30/24
gateway 10.0.20.1
bridge-ports enp3s0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094
Verify VLAN Interfaces Are Working
|
|
Debug: VM on Tagged VLAN Cannot Reach Gateway
When a Proxmox VM is configured with VLAN tag 20 but can’t reach its gateway on VLAN 20:
|
|
Missing bridge-vlan-aware yes in the Proxmox config is the most common root cause. Without it, tagged traffic passes through untagged and the VM never sees its VLAN ID.
Common Issues and Fixes
iptables Interfering with Bridge Traffic
The bridge-nf-call sysctls cause iptables rules to apply to bridged traffic. This can break container-to-container communication if your FORWARD chain has restrictive policies:
|
|
MAC Address Port Security
Some managed switches learn MAC addresses on specific ports. When a container restarts and gets a new MAC, or you migrate a VM, the switch still forwards traffic for the old MAC to the wrong port. Clear the switch’s MAC table or set the VM/container to use a static MAC:
|
|
On Proxmox, set hwaddr in the VM config under Hardware → Network Device.
MTU Mismatches
If your physical interface uses jumbo frames (MTU 9000) but Docker containers get MTU 1500, packets may get silently fragmented or dropped:
|
|
For Proxmox bridges, set the MTU on the bridge interface itself:
|
|
STP Blocking Docker Bridge Ports
STP on Docker bridges causes a 15–30 second delay every time a container starts or restarts. If you’re running containers that need fast failover or rapid restarts (like HA proxies or load balancers), disable STP on Docker-created bridges:
|
|
Automation: Bridge Health Check Script
Save this as /usr/local/bin/bridge-health.sh and run it periodically with a systemd timer:
|
|
Make it executable and set a systemd timer for every 10 minutes:
|
|
Building Your Bridge Debugging Mental Model
Linux bridges are simple devices: they learn MAC-to-port mappings, forward frames based on destination MAC, and optionally filter by VLAN. When something breaks, start at the bridge and work outward:
- Is the bridge up? —
ip link show $BRIDGE - Is the container’s veth connected? —
bridge link show/brctl show - Does the bridge have the container’s MAC? —
bridge fdb show br $BRIDGE - Can you see packets on the bridge? —
tcpdump -i $BRIDGE -e -n - Is iptables interfering? — Check
bridge-nf-call-iptables - Is STP blocking? —
brctl showstp $BRIDGE
Work this chain from bottom to top, and you’ll isolate the fault in minutes instead of hours. The tools are already on your system — learn to use them, and networking problems become much less mysterious.