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.

You May Also Like…

PHP Iterators

Just came across a Youtube talk "Iterators in PHP" by Jake Smith published in 2014 that steps through the many...

PHP array_map Multiple Arrays

array_map can take multiple arrays. I like how it starts mapping through them starting at the first element of each...