[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

retrieving MAC address

Posted on 2012-09-19
13
Medium Priority
?
846 Views
Last Modified: 2012-09-26
I would like to know, if I can retrieve MAC  address of a PC behind 2 or more routers.
If I understand a router has a MAC to IP address table of each subnet that is directly connected to its interfaces.

usually from a PC, we can ping the remote host, than type GETMAC hostname, to get the MAC  address.
I wonder if the 1st router can do the ARP proxy for us to retrieve the MAC  address of the remote PC by querying other router. if so, is it by default ?

thanks
0
Comment
Question by:jskfan
  • 4
  • 2
  • 2
  • +5
13 Comments
 
LVL 9

Assisted Solution

by:jsdray
jsdray earned 224 total points
ID: 38414786
try this:

If you want to determine the MAC address of another computer, simply ping the computer by opening the command prompt and typing ping followed by the IP address assigned to the remote computer. Since the IP address has to be resolved to the MAC address, an entry will be added to you physical address translation table. At the command prompt type arp -a. The results will display the IP address and the MAC address of the remote computer.
0
 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 224 total points
ID: 38414983
MAC addresses are not maintained across different networks, and there is no such think as a relaying proxy ARP - the IP protocol does not have any (standard) means to transfer a MAC address as part of a service. Strictly spoken, the MAC address is part of the physical layer, while IP is something one or two layers above that.
You always need to contact the device connected to the physical networks you want MAC addresses for, and ask it directly. E.g. you can RDP into a remote Windows PC, or log in to the router and query its ARP table.

If you write an own application layer protocol, and implement a client/server with that, you are free to embed MAC addresses in (routable) IP packets ;-).
0
 
LVL 78

Assisted Solution

by:Rob Williams
Rob Williams earned 224 total points
ID: 38416016
You could also use psexec to run ipconfig /all on the remote machine from a local command prompt,  and redirect the output to the local console
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
psexec \\123.123.123.123 -u domain\username -p password  ipconfig /all |find "Physical"
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:jskfan
ID: 38416579
In case you cannot remote to the remote device, but want to know its MAC Address

I believe each IP address is mapped to MAC address either in the next router or 2 or 3 or 15th router hop away...

Example:
PCA-- Router1---Router2........Router15--PCB

if you can ping PCB from PCA , it means all routers will query each other for the IP address until they get it from Router15, and when Router15 will respond back , each router in that line back to Router1 will cache the IP to MAC record in its MAC table...

That s my understanding
0
 
LVL 36

Assisted Solution

by:mccarl
mccarl earned 444 total points
ID: 38416655
each router in that line back to Router1 will cache the IP to MAC record in its MAC table...
No!! There is no need as the MAC address is only used (and only useful) on the immediate network segment, ie. between PCA and Router1, or between Router 2 and Router 3, or between Router 15 and PCB.

Think about this, if what you are saying is true, then the router that faces Google's servers, for example, would be holding the MAC address to IP address mapping for every IP address that is present in IP packets that it has received; ie. pretty much every MAC address of active public IP addresses in the world!
0
 

Author Comment

by:jskfan
ID: 38416991
Ok... so there is no way to get the MAC address of a remote PC  as example given above ?
0
 
LVL 17

Assisted Solution

by:pergr
pergr earned 440 total points
ID: 38416995
You will need to use SNMP (or some other protocol) to get the ARP table from the remote router.

The ARP table is the mapping from IP to MAC.

You would need SNMP access to the router, which is at least a "read-only" community name.
0
 
LVL 4

Assisted Solution

by:rbadua
rbadua earned 220 total points
ID: 38417174
have you tried nbtstat -a or nbtstat -A?  Also, the arp table for the particular PC will reside on whoever owns the gateway address.  Pretty much what mccarl stated.  unless youo have access to that particular router or PC....dont think you can find the MAC.
0
 
LVL 17

Assisted Solution

by:pergr
pergr earned 440 total points
ID: 38417246
Another common place to get the mac from is the dhcp log files.
0
 
LVL 36

Assisted Solution

by:mccarl
mccarl earned 444 total points
ID: 38417257
Just wondering, are you able to tell us the reason that you want to get the MAC address? Maybe if we know what you are trying to do at a more general level, there might be other solutions that don't involve getting the MAC address from the routers?
0
 

Author Comment

by:jskfan
ID: 38421156
We use SMS to remote to end users PC, sometimes users know only the name or the IP address of heir PCs.
SMS query is setup for Mac address
0
 
LVL 32

Accepted Solution

by:
masnrock earned 224 total points
ID: 38426552
You would need to set up SMS on that network if you are going to go by mac address. Arp requests are not routable across networks.

Otherwise, use a different solution that requires a client on the pc. That or if you work with an approach like having a separate connection onsite that serves as a backdoor into their network.
0
 

Author Closing Comment

by:jskfan
ID: 38435683
Thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Make the most of your online learning experience.
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

864 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