Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

(tye)Re: MAC Address and NIC Device on Network.

by tye (Cardinal)
on Jun 27, 2001 at 10:06 UTC ( #91839=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: MAC Address and NIC Device on Network.
in thread MAC Address and NIC Device on Network.

Or just parse `arp -a`.

Update: The original question seems clearly to be about Windows, which does come with "arp" (I think Win2K was mentioned in the chatterbox). Your mention of "root access" makes me wonder whether Net::Packet will work on Win2K, but I don't find it on CPAN so I didn't go any further trying to check that out.

I didn't say the method that I mentioned was the only way, of course.

Update2: Thanks for the clarifications, jepri. I can still roll code to parse `arp -a` faster than I can download NetPacket and pcap much less install them and get them working (heck, nearly faster than I can find NetPacket given how slow http://search.cpan.org/ is these days). So if all I'm interested in the MAC addresses, I'll stick with arp output unless I've already gotten NetPacket working for other reasons.

But I didn't reply to criticize your suggestion. I just waited a while and noted that no one else had mentioned "arp -a" yet so I thought it should be part of the thread. So I decided to post it in reply a node that mentioned something acurate and your fact about all TCP/IP stacks having to support ARP won. (:

        - tye (but my friends call me "Tye")


Comment on (tye)Re: MAC Address and NIC Device on Network.
Select or Download Code
Re: (tye)Re: MAC Address and NIC Device on Network.
by jepri (Parson) on Jun 27, 2001 at 10:19 UTC
    Works if you have arp. Why go outside Perl when there's a nice module that does what you want? The interface is nicer too.

    Finally arp will only return the IP number of the interface, whereas you can get so much more information with a little bit of sniffing.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-08-27 11:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (237 votes), past polls