Solved

How to convert MAC address to IP address on a WinNT network???

Posted on 2001-08-13
5
15,687 Views
Last Modified: 2013-11-13
Hi,


I have a library that can display computers which accept a certain type of RPC call
(they have a listenner running)... Only this give me a list of MAC addresses!!!

How can I convert those MAC addresses to their IP address (and eventualy to
host name) ??? I need to be able to do something like arp -a does, which is
to list computers by ip address or hortname and present this to the user,
NOT mac address which nobody knows about here ;-)

I am running Windows NT 4 sp6a.

Thanks for any info...
0
Comment
Question by:aquila98
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:BlackDiamond
Comment Utility
You have to use arp.  Remember that MAC addresses are used at layer 2 and IP is layer 3.  You will only be able to see MAC addresses that are in the same broadcast domain (on your subnet).  The easiest way is if you have a list of MAC addresses, then ping the broadcast address(x.x.x.255 for a class c) of your subnet.  Then if you do an arp -a, you will get a list of all the ip's along with the MAC address for you subnet.  Then you can do a 1 to 1 match with your 2 lists.
0
 
LVL 2

Author Comment

by:aquila98
Comment Utility
???

And how can i do an arp -a by programmation???
Remember this will be used in a VB application, so I have to present to my users a
list of IP address-> machine name -> services availables, all I have is:
MAC address...

Ideally I want a function like string _GetIpAddressFromMac(const string& MACAddress);
I do have SocketTool which does have a ICMP com object (ping)...

Is there a class that implements ARP??? Or a COM somewhere (free???)

thanks
0
 
LVL 5

Accepted Solution

by:
BlackDiamond earned 100 total points
Comment Utility
Sorry I did not answer programmatically, but you did not specify a language, and this is not a programming topic area.  Anyway, there are a couple of ways to approach this problem.  I think by far the easiest would be to make a dll in C using something like the libnet libraries ( http://sourceforge.net/projects/libnet/ ) to perform the needed tasks, and then simply reference those calls in your VB app.  If you want to see how to do pings in VB, take a look here http://www.mvps.org/vbnet/code/network/ping.htm ..  I have yet to find any good arp examples in VB, but I'll keep looking and let you know if I find any.
0
 
LVL 2

Author Comment

by:aquila98
Comment Utility
Thanks...

I'll look it up also... Anyway I could always do it "manually" and insert the table MAC->IP into
a map and build a ini file around that so my VB app would "know" which IP address
corresponds to which MAC address... For a while at least.


0
 
LVL 5

Expert Comment

by:BlackDiamond
Comment Utility
Yeah, that's a decent work around.  Do you have the source for the RPC library that you are using?  It just occurred that it probably has the IP address and the MAC already, but is just not returning the IP to you.  The other thing you could do is bug whoever made the library.  It would probably be a very small change to make that info available to the user (or maybe it is, and is just not documented).  It seems that the library would be much more useful with that feature. hmmm.
Cheers,
BD
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now