Cisco IOS

What is show mac address-table in Linux?

On a Linux bridge, the equivalent of show mac address-table is bridge fdb show. This is the forwarding database: which MAC addresses the bridge has learned and which port each is behind. It is a different table from ip neigh show, which maps IP addresses to MACs.
Try it in a live lab

Free interactive lab. No signup. Runs in your browser.

Command by command

Cisco IOSLinuxWhat it gives you
show mac address-tablebridge fdb showEvery learned MAC and its port
show mac address-table interface ge0bridge fdb show dev ge0One port
show mac address-table countbridge fdb show | wc -lNo built-in count
clear mac address-table dynamicbridge fdb flush dev br0Clear learned entries
show mac address-table vlan 10bridge fdb show vlan 10Per 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 →