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

0 Comments

Submit a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Network speed test host to host

On Ubuntu / Debian apt-get install iperf3 On Windows download it from https://iperf.fr/iperf-download.php#windows Make...

Clear HSTS Settings in CHrome

Open chrome://net-internals/#hsts enter the domain in the query field and click Query to confirm it has HSTS settings...