Home: General Discussions: General Questions:
Same Subnet:MacAdress from IP Address


Sep 5, 2008, 10:57 AM

Views: 7022
Same Subnet:MacAdress from IP Address

I have an ipaddress(of a remote machine) which is in the same subnet.Is there a way to get the MacAddress of the corresponding remote machine.

New User

Dec 30, 2008, 4:33 AM

Views: 5495
Re: [Kishorerp] Same Subnet:MacAdress from IP Address

If the remote host is in the same subnet and network segment as your computer, you can reference the ARP table of your machine. You'll need to look at your OS's documentation to find out how to view your ARP table, as each OS is different.

However, if prior communication has not occurred between your computer and the remote host, your computer may not have an existing ARP entry, so you wont find anything. So you may need to send some data to the remote host and have it respond first.

You could use Net::Ping to ping the known IP address until it responds. As soon as it responds your computers ARP table will contain an entry which will tell you what the MAC address is of the remote machine.

(This post was edited by TomS_ on Dec 30, 2008, 4:34 AM)