Find the interface based on MAC or IP address on Cisco ASR 9000 (IOS-XR)

Note: This steps are based on bridge domain/VPLS  setup on Cisco ASR 9000 running Cisco IOS-XR. For normal routed interfaces,  you can find it using the command:

show arp <interface>

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 route <IP>

RP/0/RSP1/CPU0:ASR9K#show route 192.168.15.6

Routing entry for 192.168.15.0/29
Known via “connected”, distance 0, metric 0 (connected)
Installed May 16 16:14:23.050 for 04:01:46
Routing Descriptor Blocks
directly connected, via BVI888
Route metric is 0
No advertising protos.

Note: From the output above, we found out that is routed via Bridge Virtual Interface 888 (BVI888)

b. Show the arp for the interface

show arp <interface>

RP/0/RSP1/CPU0:ASR9K#show arp BVI888

0/1/CPU0
——————————————————————————-
Address Age Hardware Addr State Type Interface
192.168.15.1 – f217.43fd.f866 Interface ARPA BVI888
192.168.15.5 02:17:16 a111.b222.c333 Dynamic ARPA BVI888
192.168.15.6 00:02:25 d444.e555.f666 Dynamic ARPA BVI888

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 configuration of the interface to see which bridge group/domain it is configured.

show run formal | i <string>

RP/0/RSP1/CPU0:ASR9K#show run formal | i BVI888

Building configuration…
interface BVI888
interface BVI888 description Server Farm1
interface BVI888 ipv4 address 192.168.15.1 255.255.255.248
l2vpn bridge group 9999 bridge-domain 9999 routed interface BVI888

Note: From the output above, we found out that bridge-domain is 9999 for routed interface BVI888

d.  Use this command to find the which interface that the given mac address is learned from.

show l2vpn forwarding bridge-domain <bridge group_name: bridge domain_name> mac-address location 0/x/CPU0

Sample:

RP/0/RSP1/CPU0:ASR9K#show l2vpn forwarding bridge-domain 9999 :9999 mac-address d444.e555.f666 location 0/1/CPU0

Mac Address Type Learned from/Filtered on LC learned Age Mapped to
——————————————————————————————
d444.e555.f666 dynamic Gi0/1/0/1 0/1/CPU0 0d 0h 0m 0s N/A

Note: From the output above, we found out that mac address d444.e555.f666 is connected to interface Gi0/1/0/1

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

show l2vpn forwarding bridge-domain <bridge group_name: bridge domain_name> mac-address location 0/x/CPU0

Sample:

RP/0/RSP1/CPU0:ASR9K#show l2vpn forwarding bridge-domain 9999 :9999 mac-address a111.b222.c333 location 0/1/CPU0

Mac Address Type Learned from/Filtered on LC learned Age Mapped to
——————————————————————————————
a111.b222.c333 dynamic Gi0/1/0/0 0/1/CPU0 0d 0h 0m 0s N/A

2 Comments

  1. RonF said:

    “RP/0/RSP1/CPU0:ASR9K#show l2vpn forwarding bridge-domain 9999 :9999 mac-address d444.e555.f666 location 0/1/CPU0”

    I need to find what interface a given MAC address is being learned from , but I have no idea what a bridge domain is. I don’t see anything labelled like that in the config.

    • Free Network Tutorials said:

      @RonF which device are you using? And what OS is it running?

Leave a Reply

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