brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: bridge fdb show lists which MAC address sits behind which bridge port

Linux
~/tips/tip-linux-bridge-fdb-show

bridge fdb show br br0

Prints the forwarding table of a Linux bridge, so you can see where a MAC address lives.

When a VM or container on a bridged network is unreachable, I want to know where the bridge thinks it lives. The forwarding table answers that, and the bridge tool prints it.

bridge fdb show br br0

It displays the current forwarding table of the bridge br0. Each entry ties a MAC address to a port. If the MAC address you expect isn’t behind the port you expect, you have a pointer for where to look next.

The docs list these filters for show:

  • br BRDEV for one bridge
  • brport DEV for one port
  • vlan VID for one VLAN
  • state STATE and dynamic to filter on the state of an entry

For example, all entries learned on one port:

bridge fdb show brport eth1

With -statistics the output also includes the time each entry was last updated and last used:

bridge -statistics fdb show br br0

The sibling bridge link show lists the ports of all bridges with their configuration and flags, and takes dev DEV or master DEVICE to narrow it down. And bridge monitor fdb follows changes as they happen. Its object list may contain link, fdb, vlan and mdb.

The caveat: it only works on a host that actually has a bridge, so you run it on the Linux host, not inside a guest.

Further reading: bridge(8)

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link