From: "StÃ¥le Z.H" Date: 2008-08-02T07:34:58+09:00 Subject: Re: Determining MAC address On 1 Aug, 22:48, Glen Holcomb wrote: > On Fri, Aug 1, 2008 at 2:09 PM, Ståle Z.H wrote: > > On 1 Aug, 16:03, Glen Holcomb wrote: > > > [Note:  parts of this message were removed to make it a legal post.] > > > > What would be the best (clean, cross-platform) way of determining the MAC > > > address of a host when you have the hostname and IP address? > > > > -- > > > "Hey brother Christian with your high and mighty errand, Your actions > > speak > > > so loud, I can't hear a word you're saying." > > > > -Greg Graffin (Bad Religion) > > > You could craft an ARP packet and put it on the wire. (I've written a > > couple of classes that uses libnet and pcap to craft and capture ARP > > packets if you're interested.) Of course, this requires the target to > > be on the LAN. It might not be the easiest or cleanest way to do this, > > but it should work and it should be cross-platform, heh. > > Thanks for the ARP suggestion, I might be interested.  Some of the machines > in question are on the same VLAN however others are not.  Right now the > values have to be entered manually and for my area that isn't too big of a > pain as I only have around 70 machines.  However to go institution wide that > would be a giant headache so any automation would be better than none. > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) Alright, you could of course just use a laptop and connect it to each network in turn if the machines aren't spread across too many networks. Just send me an email or whatever if you're interested in the ARP injection/capture code. :)