|
From: jebblue on 18 Jul 2008 23:01 On Mon, 14 Jul 2008 03:03:24 -0700, BigZero wrote: > is there any way or posable to get a ip-Address from mac address, i mean > that i have the mac address of a machine and i want to known the ip > address of that mac id or machine..... This might help: http://forums.sun.com/thread.jspa?messageID=9818642&tstart=0 -- // This is my opinion.
From: Roedy Green on 21 Jul 2008 17:27 On Mon, 14 Jul 2008 03:03:24 -0700 (PDT), BigZero <vijaymajagaonkar(a)gmail.com> wrote, quoted or indirectly quoted someone who said : >is there any way or posable to get a ip-Address from mac address, i >mean that i have the mac address of a machine and i want to known the >ip address of that mac id or machine..... try this: use NetworkInterface.getByName to get a NetWorkInterface object. Check you have the correct MAC with getHardwareAddress. use getInetAddresses to get a list of associated IPs. If that does not work, horse around with java.net.NetworkInterface methods. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
From: Tom Anderson on 22 Jul 2008 12:44 On Mon, 21 Jul 2008, Roedy Green wrote: > On Mon, 14 Jul 2008 03:03:24 -0700 (PDT), BigZero > <vijaymajagaonkar(a)gmail.com> wrote, quoted or indirectly quoted > someone who said : > >> is there any way or posable to get a ip-Address from mac address, i >> mean that i have the mac address of a machine and i want to known the >> ip address of that mac id or machine..... > > try this: > > use NetworkInterface.getByName to get a NetWorkInterface object. > > Check you have the correct MAC with getHardwareAddress. > > use getInetAddresses to get a list of associated IPs. > > If that does not work, horse around with java.net.NetworkInterface > methods. I think the OP was asking about doing MAC -> IP for a *remote* machine. NetworkInterface will only help you for interfaces on the local host. tom -- Sometimes it takes a madman like Iggy Pop before you can SEE the logic really working.
From: Roedy Green on 22 Jul 2008 14:19 On Tue, 22 Jul 2008 17:44:56 +0100, Tom Anderson <twic(a)urchin.earth.li> wrote, quoted or indirectly quoted someone who said : >I think the OP was asking about doing MAC -> IP for a *remote* machine. IIRC the MACs of remote machines are considered secret. He then knows the MAC through some mysterious means. I would not hold out hope of any ability to manipulate MAC to IP without running some code on the remote machine. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
From: Mark Space on 22 Jul 2008 16:37
BigZero wrote: > well i m getting mac address from SNMP, i known that i can get ip > address if i query the ip OID. > but the ip address changes(DHCP) so we want to keep the history of a > machine so i m using mac address that never changes, so here all want In this sort of scenario, it's usual to give the machine a name that doesn't change (for example, machine1.example.com) and then use that to look up the machine. That way if IP address changes, the name doesn't. If you have some IT genius who's invented some sort of random, changing name policy, they you're hosed. On unix, you can use nslookup to find server names from IP addresses. I don't see an nslookup for Java, but Google yields some hits when searching, so you might find some free Java code that does what you need. |