Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2001-08-13
5
Medium Priority
?
15,763 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

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
Tech spooks aren't just for those who are tech savvy, it also happens to those of us running a business. Check out the top tech spooks for business owners.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

604 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