Find the interface based on MAC or IP address on Cisco Nexus 7000 (NX-OS)

Here are the sample steps on finding the interface where the host is connected based on IP address or MAC address on Cisco Switch Nexus 7000 series running in Nexus OS.

Scenario 1: IP address is given, find which interface it is connected
IP address: 192.168.15.6

a. Find the routing entry for the IP to know where it is connected

show ip route <IP>

NEXUS7000# show ip route 192.168.15.6
IP Route Table for VRF “default”
‘*’ denotes best ucast next-hop
‘**’ denotes best mcast next-hop
‘[x/y]’ denotes [preference/metric]
‘%<string>’ in via output denotes VRF <string>

192.168.15.6/32, ubest/mbest: 1/0, attached
*via 192.168.15.6, Vlan888, [250/0], 4y32w, am

Note: From the output above, we found out that is routed via VLAN 888

b. Show the arp for the interface

show ip arp <interface>

NEXUS7000# show ip arp Vlan888

Flags: * – Adjacencies learnt on non-active FHRP router
+ – Adjacencies synced via CFSoE
# – Adjacencies Throttled for Glean
D – Static Adjacencies attached to down interface

IP ARP Table
Total number of entries: 3
Address Age MAC Address Interface
192.168.15.1 00:13:46 0000.0c9f.f001 Vlan888
192.168.15.2 00:13:23 a111.b222.c333 Vlan888
192.168.15.6 00:14:51 d444.e555.f666 Vlan888

Note: From the output above, we found out that the IP 192.168.15.6 mac address is d444.e555.f666 , now we need to find now where the interface it is connected.

c. Show the mac address table

show mac address-table address <MAC address>

NEXUS7000# show mac address-table address d444.e555.f666
Note: MAC table entries displayed are getting read from software.
Use the ‘hardware-age’ keyword to get information related to ‘Age’

Legend:
* – primary entry, G – Gateway MAC, (R) – Routed MAC, O – Overlay MAC
age – seconds since last seen,+ – primary entry using vPC Peer-Link,
(T) – True, (F) – False , ~~~ – use ‘hardware-age’ keyword to retrieve age info
VLAN MAC Address Type age Secure NTFY Ports/SWID.SSID.LID
———+—————–+——–+———+——+—-+——————
* 888 d444.e555.f666 dynamic ~~~ F F Eth103/1/1

Note: From the output above, we found out that mac address is mapped or learned from Eth103/1/1

d.  Verify the interface

show run interface <interface>

NEXUS7000# show run int Eth103/1/1

!Command: show running-config interface Ethernet103/1/1

interface Ethernet103/1/1
description Connection to ServerA
switchport
switchport access vlan 888
no shutdown

NEXUS7000#

Scenario 2: MAC address is given, it is pretty straightforward to find where is being learned by what interface
MAC address: a111.b222.c333

show mac address-table address <MAC address>

NEXUS7000# show mac address-table address a111.b222.c333
Note: MAC table entries displayed are getting read from software.
Use the ‘hardware-age’ keyword to get information related to ‘Age’

Legend:
* – primary entry, G – Gateway MAC, (R) – Routed MAC, O – Overlay MAC
age – seconds since last seen,+ – primary entry using vPC Peer-Link,
(T) – True, (F) – False , ~~~ – use ‘hardware-age’ keyword to retrieve age info
VLAN MAC Address Type age Secure NTFY Ports/SWID.SSID.LID
———+—————–+——–+———+——+—-+——————
* 888 a111.b222.c333 dynamic ~~~ F F Eth103/1/9

Be First to Comment

Leave a Reply

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