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

Re: getting mac address

by SciDude (Friar)
on Oct 09, 2004 at 01:07 UTC ( #397817=note: print w/ replies, xml ) Need Help??

in reply to getting mac address

This is not exactly a perl question... but here is one answer.

Simple MAC queries depend upon the operating system used:
Operating systemMethod
Windows 95 and newerwinipcfg
Windows NT and neweripconfig /all
Linux and some Unixifconfig -a
Macintosh with Open TransportTCP/IP Control Panel - Info or User Mode/Advanced
Macintosh with MacTCPTCP/IP Control Panel - Ethernet icon

In addition, you can also find the MAC of all computers on your network. If using linux, the arp utility (/sbin/arp) will display cached arp requests on your machine:

$ ./arp -a ? ( at 00:06:25:E7:E8:09 [ether] on eth1 ? ( at 00:06:25:2F:69:6F [ether] on eth1

You may have to ping the machine first to ensure the information is contained in the cache.

Manufacturer Information

On a side note, the first 24 bits of the MAC identifies the device manufacturer via the Organizationally Unique Identifiers (OUI). A simple perl script can probe the IEEE database of OUI to determine the related hardware per MAC address.


You may also want to look at SNMP::BridgeQuery

The first dog barks... all other dogs bark at the first dog.

Comment on Re: getting mac address
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2015-11-30 14:44 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (773 votes), past polls