?
Solved

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

Posted on 2001-08-13
5
Medium Priority
?
15,747 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:BlackDiamond
ID: 6381358
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
ID: 6381422
???

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 400 total points
ID: 6381725
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
ID: 6383688
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
ID: 6384546
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

Bringing Advanced Authentication to the SMB Market

WatchGuard announces the acquisition of advanced authentication provider, Datablink, with one mission – to bring secure authentication to SMB, mid-market, and distributed enterprises with a cloud-based solution, ideal for resale via their established channel & MSSP community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
This article explains the fundamentals of industrial networking which ultimately is the backbone network which is providing communications for process devices like robots and other not so interesting stuff.
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Suggested Courses

762 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