in reply to How to get Mac Address from IP

Based solely on the "Name" (for I have no experience with neither one of them), I think you're looking at the wrong module.

NetPacket::ARP: "Assemble and disassemble ARP (Address Resolution Protocol) packets."
Net::Address::Ethernet: "find hardware ethernet address."
--
b10m

Replies are listed 'Best First'.
Re: Re: How to get Mac Address from IP
by arden (Curate) on Jan 13, 2004 at 17:31 UTC
    Sorry b10m, but bengmau is looking for the MAC of a remote system on his domain. According to CPAN, Net::Address::Ethernet only finds the MAC of the local machine.

    Unfortunately bengmau, I don't have an answer strictly in perl for you yet, I just didn't want you to get frustrated with this module. Abigail-II's solution below works great if there's already an entry in your arp table. You might want to ping the ip just before you do the arp -a on it... Oh yeah, and make sure that either arp is in your path or address it explicitly.