Solved

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

Posted on 2001-08-13
5
15,708 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
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 100 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Replication dns zone issue 2 41
moving away from .local domain 5 70
Which ports are used when using implicit TLS? 8 30
VPN Server config in Modem 5 31
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

821 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