ARP table with logical and physical interfaces

In a layer-3 switching environment, the ARP table displayed with the show arp command lists the logical (L3) interfaces, for example the VLAN or BVI interface. This Tcl script displays the logical as well as physical interface associated with each IP/MAC address.

Martin Hecko gave me the idea for this script and helped to test it on a Catalyst switch. Thank you!

You can find more Tclsh-related information in the Tclsh on Cisco IOS tutorial. Sample Tclsh scripts are available in the Tclsh script library. If you need expert help in planning, developing or deploying Tclsh scripts in your network, contact the author.

8 comments:

  1. Hi Ivan

    Its a gud scrip. Do you have any script which can tell me how many routers are in my particular area. e.g If i am having a router with 3 areas and i wnat to know how many router ids in each area with their ip address.
    I have one more query , yesterday iw as reading your books mpls vpn arch, in which you had mentioned that on Bi-Dir MVPN data mdt wonot work. I have a query If we implement BSR then does it create the same problem or not and with this can we deliver the extranet mvpn.
    regards
    shivlu

    ReplyDelete
  2. The OSPF idea is good :) You'll get the script ... just give me some time ;)

    As for the MVPN question, I have to think it through; I'm no multicast guru.

    ReplyDelete
  3. Hi,

    I'm just starting to work with tcl scripts. I found the arp.tcl and it workt fine. However, when I execute the command on our Cisco Catalyst 6513 running on IOS s72033-advipservicesk9_wan-mz.122-18.SXF14.bin we do not see the physical interface.

    If I run a show -mac-addres-table command myself teh output looks like:

    vlan mac address type learn age ports

    --------------------------------------------------------------------------------
    +----------------+--------+-----+----------+--------------------------
    606 3333.0000.0001 static Yes - Switch,Stby-Switch
    607 3333.0000.0001 static Yes - Switch,Stby-Switch
    602 001b.7803.5faa dynamic Yes 0 Gi9/42
    669 0013.211f.f061 dynamic Yes 5 Po3
    11 7a9f.b000.2003 dynamic Yes 0 Gi10/27
    74 0013.216b.ab27 dynamic Yes 75 Gi9/12
    18 0017.a48d.546b dynamic Yes 0 Gi9/6


    Etc. I really want to see the Gix/x entries back in the arp output. That would save me tons of time. Thnax in advamce for your reaction.

    ReplyDelete
  4. dhcp snooping feature on L3 switch can get you the same information as arp.tc script.
    It need configure dhcp snooping, wait filling of dhcp snooping database. Enter:
    sh ip dhcp snoop bin

    ReplyDelete
  5. I am having the same problem as C on my 3550. The physical interfaces are missing. And the Port Channel is not displayed correctly as well.
    3550-PWR#arp
    IP address MAC address Physical intf Logical intf
    =============== ============== ==================== ===========
    33.33.55.1 0012.80f0.0b00 Port
    192.168.15.91 001b.21c8.d0ac Vlan15
    192.168.15.41 000c.29b5.5526 Vlan15
    192.168.15.40 0050.568e.4c60 Vlan15
    192.168.15.4 c43d.c79a.dd3c Vlan15
    192.168.15.2 0011.20e4.2830 Vlan15
    192.168.15.1 001f.9eec.5441 Vlan15


    The mac address is here
    15 000b.5f0f.a680 DYNAMIC Gi0/2
    15 000b.5f0f.a6b1 DYNAMIC Gi0/2
    15 000c.29b5.5526 DYNAMIC Gi0/1
    15 000c.29e3.eb96 DYNAMIC Gi0/1
    15 000f.f7d4.b69e DYNAMIC Fa0/17
    15 0011.20e4.2830 DYNAMIC Fa0/13
    15 0017.95ae.6377 DYNAMIC Fa0/5
    15 0019.2f4e.67dd DYNAMIC Fa0/3
    15 001b.21c8.d0ac DYNAMIC Gi0/1

    Any ideas?

    ReplyDelete
  6. The script has the wrong command for a 3550. show mac address-table
    split [exec "show mac-address-table"] "\n"]
    should be split [exec "show mac address-table"] "\n"] {

    ReplyDelete
  7. i dont know what i am doing wrong folks, but this is what i get when i run the script.

    testswitch#arp
    IP address MAC address Physical intf Logical intf
    =============== ============== ==================== ===========

    ReplyDelete
    Replies
    1. You're using a platform that has a different printout format. You'll have to adapt the script to the outputs generated by your platform,

      Delete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.