Search code examples
perlmodulecpanarp

Perl module Net::ARP, arp_lookup


I want to look up a MAC adrress by an IP.

use Net::ARP;
$mac = Net::ARP::arp_lookup($dev,"192.168.1.1");

But on the CPAN page, they don't explain what is this $dev variable for?


Solution

  • $dev is the network interface to use to try to connect to the given IP address. In the other methods, 'lo' and 'eth0' are given as examples.