Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
The way you find out NIC addresses is using ARP, or Address Resolution Protocol. It is used by Ethernet network drivers to figure out what the MAC address of a given destination is. You can use ARP to do what you want.

There's two tricks, both UNIX-based. Your system and privileges will affect what you can choose.

The easy way, though it requires "root" level access on a UNIX-type system, is to use 'arping'. You just tell it who you want to ping, and where, and it comes back with an ARP response all broken out for you, such as:    Unicast reply from 24.114.X.X [00:01:64:A5:F9:00]  2.588ms
The other way is to just use the off-the-shelf 'ping' program a whole whack of times to stimulate ARP responses from as many remote nodes is required. Remember that there won't be any entries in the ARP table unless the machine your on hasn't had to communicate with anyone. The ARP entries also expire after a period of time, though it is at least a few minutes.

Then you can read the ARP table directly from your system (i.e. /proc/arp) or by using the 'arp' program which will give you something like:
? (10.3.3.10) at 00:E0:29:25:7A:46 [ether] on eth0 ? (24.114.X.X) at 00:01:64:A5:F9:00 [ether] on eth1
Once you've got the MAC address, you can do a few lookups to find out who might have made that gear. Each "vendor" is allocated a unique three-octet beginning, so you can guesstimate what that device is by this data.

The trick is to find a comprehensive table of registrations. The IANA (Internet Assigned Numbers Authority) is supposed to do this, but their material is out of date even though they are the ones who issue numbers. Can you believe they have a "gopher://" URL in that file? Yikes.

The IEEE seems to have a pretty good, parsable file at here. See if that's to your liking.

In reply to Re: MAC Address and NIC Device on Network. by tadman
in thread MAC Address and NIC Device on Network. by tapesorcdz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (7)
    As of 2014-12-25 10:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (160 votes), past polls