Page 1 of 1
Acquiring MAC Address of Remote System
Posted: Thu May 25, 2006 11:04 am
by dann
Generally speaking MAC addresses will not cross routers. But there must be a way to get the MAC address of a remote system. I've seen it done with a program called Network View. So why can I not do this on Linux?
We need to inventory some information on all our computers: Ip Address, Mac Address, building, room, id number, hostname etc. I figured on putting up a form but have it pull the system's ip address and mac address automatically so it can be easily dropped into a database. It works fine locally, but if we go to another building, I cannot get the MAC address as we are now on a seperate network.
Re: Acquiring MAC Address of Remote System
Posted: Fri May 26, 2006 10:34 am
by Gomer_X
dann wrote:Generally speaking MAC addresses will not cross routers. But there must be a way to get the MAC address of a remote system. I've seen it done with a program called Network View. So why can I not do this on Linux?
I don't have my TCP/IP book handy, but I'm pretty sure the MAC is not in the IP packet. The mapping happens at the LAN level. The router knows which IP belongs to which MAC. You may have to get the router to give you that info.
HOw to do that is an exercise left to the student.
Can you run something on a machine on the remote network?
Posted: Fri May 26, 2006 12:59 pm
by dann
Running something on the target machine begins to extend beyond the simplicity I wanted to achieve here. The person will be sitting down in front of the remote system and going to a web page. They could just run ipconfig /all and paste the MAC address into a form field, but I was hoping this would be able to be culled automatically.
I'm wondering how netview does it. There has been no special configuration on our end for this app to work. We pointed it to a remote netware server and it pulled up the proper MAC address.
Posted: Fri May 26, 2006 1:35 pm
by snarkout
look at the arp cache on your router local to that machine?
Posted: Sat May 27, 2006 12:00 pm
by dann
But now I have to connect to the router to do that which defeats the purpose.
Posted: Sat May 27, 2006 10:49 pm
by StoneChucker
How about having the end user execute a batch file, containing:
Code: Select all
ipconfig /all X:\%COMPUTERNAME%.txt
where X: is a shared network location (could be mapped within the batch file if not already present), and %COMPUTERNAME% is a standard system variable of the "computername".
I think that will get you what you want, on a Windows PC anyways (as you mentioned ipconfig).
Hope this helps,
StoneChucker
Posted: Tue May 30, 2006 6:29 pm
by vagrant
Ok, well I work a *lot* on writing code in this space and here's the problem. Network View uses WMI to gather this information. So on Windows machines there is a WMI namespace called Win32_NetworkAdapterConfiguration.
The problem is that there is no implementation on *nix which allows querying of WMI, well natively on Linux anyway.
But Dann, what exactly is the problem? Is it just that you can't do this from Linux or what? My development is mainly focused solving problems like this. If I could gather WMI information from Linux my entire development system would be totally different!
Unfortunately, writing a program to solve this problem for Windows is a no-brainer but on Linux its very different (until someone decides to implement the DCOM interfaces to make it possible).