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…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...