MoonPoint Support Logo


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals

Advanced Search
Sun Mon Tue Wed Thu Fri Sat

Wed, Feb 01, 2006 6:49 pm

Get ARP Table

I needed to be able to get the ARP table from Cisco devices, so I created get_arp, a Perl script which will query a router, switch, etc. via SNMP and obtain the ARP table from the device. There are two mandatory arguments for the script, the hostname or IP address for the device and the read-only community string for the device. If given only those two arguments, the script will produce output similar to what is shown below:
% ./get_arp tViSoN1a
ARP table for on Wed Feb  1 22:21:38 2006 = 0:30:f2:ec:17:fc = 0:30:f2:ec:8b:fc = 0:30:f2:ec:17:ff = 0:30:f2:ec:8b:ff = 0:90:b1:81:e9:0 = 0:60:3e:7e:c7:40 = 0:9:b7:7d:e6:0 = 0:60:3e:7e:1e:a0 = 0:f:f7:5b:b:0 = 0:f:f7:5d:64:f0

An optional argument "--nomac" will cause the script to only display the IP addresses in the ARP table, not the MAC addresses associated with the IP addresses as shown below:

% ./get_arp --nomac tViSoN1a
ARP table for on Wed Feb  1 22:21:49 2006

To use the script, download the script and use chmod 744 to make the script executable by the owner. Modify the first line, if Perl is located somewhere else on your system, which you can determine by the command which perl. The script relies on the snmpwalk utility, which is available from You can determine if it is available on your system already by issuing the command which snmpwalk.

[/network/snmp] permanent link

Once You Know, You Newegg AliExpress by

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo