in reply to mac to IP address?
If I take your question at face value I have to answer "NO" and say that there is no mapping of MAC address ==> IP address in the strictest sense of the wording. A MAC address is a hardware address usually assigned by a manufacturer (on some hardware you can set all or some of the MAC address in the field but I believe that has been depricated in most cases) and an IP address is assigned by a system or network administrator.
On the other hand, depending your OS you can to a very limited degree find a matching IP address for a given MAC and let me iterate some of the methods I would pursue:
Mentioned elsewere in this thread is the concept of using an APR cache to lookup a hardware address and map it to an IP address. Let me look at two approaches for that:
Note:IP addresses and names been changed to protect me!$ /sbin/arp -a router.isp.net (168.239.116.1) at 00:01:5C:22:3C:42 [ether] on eth0
The HUGE disadvantage this method has is only the ARP addresses for my local subnet are valid. If a host on the other side of the router from me then what is mapped into the ARP cache for a given IP address is the MAC address of the router. Not much help is it?
In point of fact I wrote something called routerWalk several years ago that does just that. It logs onto the first router it sees, dumps its ARP cache, sifts through it and compares it to the routing table to determine which MAC addresses are valid and which belong to routers and stores the reesult. I wrote this in order to validate data stored in our IP Management system (QIP) and find unregistered hosts.
For that application that approach worked well but to do this every time you run a script that wants to reference that data would be impractical and a major PITA as well as not exactly a good way to make friends with your network operation folks.
In my environment I can actually query for that information against my QIP database and solve the problem that way.
Enjoy!
| Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
| Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. | |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: mac to IP address?
by iburrell (Chaplain) on Jan 27, 2004 at 01:57 UTC | |
by blue_cowdawg (Monsignor) on Jan 27, 2004 at 14:07 UTC |