Command by command
| Cisco IOS | Linux | What it gives you |
|---|---|---|
show mac address-table | bridge fdb show | Every learned MAC and its port |
show mac address-table interface ge0 | bridge fdb show dev ge0 | One port |
show mac address-table count | bridge fdb show | wc -l | No built-in count |
clear mac address-table dynamic | bridge fdb flush dev br0 | Clear learned entries |
show mac address-table vlan 10 | bridge fdb show vlan 10 | Per VLAN, when filtering is on |
What the output looks like
$ bridge fdb show br br0
02:42:0a:00:01:02 dev vp-sw1 vlan 10 master br0
02:42:0a:00:01:05 dev vp-sw2 vlan 20 master br0
33:33:00:00:00:01 dev vp-sw1 self permanent
Why the two differ
A Cisco switch is a switch, so the MAC table is a first-class object. On Linux, switching is a function of the bridge driver, and the forwarding database belongs to a specific bridge device rather than the machine. That is why the command takes a bridge — bridge fdb show br br0 — and why a host with no bridge configured has no such table at all. Entries marked permanent are the bridge's and ports' own addresses rather than learned ones; the nearest Cisco equivalent is the switch's own STATIC entries pointing at the CPU.
The trap
bridge fdb show with no arguments lists entries for every bridge and every port, including permanent and multicast entries, which makes it look far busier than a Cisco MAC table. Narrow it with br <bridge> or dev <port>, or you will be reading rows that are not learned addresses at all.
Common questions
Why is the table empty?
Bridges learn addresses from traffic they forward. A bridge that has just come up, or one whose ports have seen no frames, has an empty database. Generate traffic and look again.
Do I need bridge or is there an older command?
brctl showmacs br0 did the same job and is part of the deprecated bridge-utils package. bridge fdb show from iproute2 is the current tool and is the one that understands VLAN filtering.
Stop reading, start running
Open the lab in your browser and work with the same idea on a running network. No install, no signup.
Launch the lab →