Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How can I find a MAC address from aremote IP ?

by arhuman (Vicar)
on Mar 30, 2001 at 19:06 UTC ( #68386=note: print w/ replies, xml ) Need Help??


in reply to How can I find a MAC address from aremote IP ?


NetPacket::ARP should be able to do the job...
or using `arp -a` and a regex (dirty but works on unix and windows...)

(It may be useful to ping the host before using arp
to refresh the arp table in the case the entry is not present)


"Only Bad Coders Badly Code In Perl" (OBC2IP)


Comment on Re: How can I find a MAC address from aremote IP ?
Re: Re: How can I find a MAC address from aremote IP ?
by Malkavian (Friar) on Mar 30, 2001 at 20:05 UTC
    Hmm.. You sure arp works on a distant remote IP?
    From memory, it's only local subnet.
    Plus, I don't think you get a valid MAC address from a PPP link either.
      Oops ! You're right arp will only work with local IP addresses...
      (I always forget to mention...)

      "Only Bad Coders Badly Code In Perl" (OBC2IP)

      Nothing is going to tell you the MAC address of something that is not within your local broadcast domain! You'd have to get some code to run in the local broadcast domain of the remote IP address and have it forward you the information.

      And PPP links don't have MAC addresses. A MAC address is an Ethernet thing and you don't run PPP over Ethernet.

      So I would assume that the original question was asking for a MAC address of an Ethernet (and non-PPP) adapter that was not local to the computer but that was in the local broadcast domain -- nothing else makes much sense. So ARP is the most logical answer.

              - tye (but my friends call me "Tye")
        Actually.. MAC addresses are not an Ethernet thing. Token Ring uses them too... The reason Remote networks are usually harder to get MAC address for could be because of Hardware Address Translation. It all depends on how the routers are set up.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://68386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2014-07-22 15:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (117 votes), past polls