Cisco Switch ports and MAC addresses

ciscomac address

Good morning,

How do I find out which port on a Cisco switch is connected to a particular MAC address? I recently took over Network Administrator position and trying to clean up and organize. Thank you for your help 🙂

Best Answer

On most Cisco switches the command is:

sw1#show mac address-table 
Aging time is 300 sec

  Vlan        Mac Address         Port       Type    
-------- --------------------- ---------- ---------- 
   1       00:0b:d6:25:f0:0f      gi23     dynamic   
   1       00:13:19:1e:ac:8d      gi28     dynamic   
   1       00:18:b9:2f:e3:87      gi12     dynamic   
...

If you're tidying up switches, you might also find the Cisco Discovery Protocol (and similar LLDP) very useful:

sw1#show cdp neighbors 

    Device ID       Local      Adv  Time To Capability   Platform     Port ID   
                    Interface  Ver. Live                                        
------------------ ----------- ---- ------- ---------- ------------ ----------- 

       sw2            gi28      2     129      S I     Cisco           gi28     
                                                       SG300-28PP               
                                                       (PID:SG300-2             
                                                       8PP-K9)-VSD              
...

If you're using a switch by web interface, look on menu for "MAC Address Table > Dynamic Addresses". For CDP it's under "Administration > Discovery (CDP) > CDP Neighbor Information". (Or matching LLDP if using that instead of CDP.)