Command to find which Server NIC is Connected to which Cisco Switch Port

Written by James McDonald

February 6, 2013

Command to find out which ethernet card is connected to which Cisco switch port

show mac-address-table  | include b8ac.6f98

  10    b8ac.6f98.4cdf    DYNAMIC     Gi0/23
   1    b8ac.6f98.4cd7    DYNAMIC     Gi0/8
   1    b8ac.6f98.4cd9    DYNAMIC     Gi0/3

Where the above values are:
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----

Note: You may have to ping the ip of the server NIC to get the MAC to appear in the switch mac-address-table

Use show mac-address-table and then narrow it down by piping the output to the include command restricted to part of the servers MAC  address

Display your server MAC addresses with:

 ifconfig -a | grep HWaddr
eth0      Link encap:Ethernet  HWaddr B8:AC:6F:98:4C:D7
eth1      Link encap:Ethernet  HWaddr B8:AC:6F:98:4C:D9
eth2      Link encap:Ethernet  HWaddr B8:AC:6F:98:4C:DB
eth3      Link encap:Ethernet  HWaddr B8:AC:6F:98:4C:DD


Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

Toggen builds a new website

So I have built and hosted a new website for Roger Clark Pest Management they are a family owned and operated Pest...


Just downloaded WizTree (not a sponsor) from It seems to do what it says on the tin which is...

Scam call from “Telstra”

Just had a call from a man with a sub-continental accent from caller ID 0734946596 Told me there was problem with my...