Perl module Net::ARP, arp_lookup
I 开发者_C百科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?
$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.
精彩评论