mac address ?

Status
Not open for further replies.

allan16

In Runtime
Messages
378
Hi:

Is there a way to get the MAC address of another computer knowing the ip of that computer or the other way around from the Command Prompt ?

Thanks
 
ping the address, then
arp -a should work

C:\>arp /?

Displays and modifies the IP-to-Physical address translation tables used by
address resolution protocol (ARP).

ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]

-a Displays current ARP entries by interrogating the current
protocol data. If inet_addr is specified, the IP and Physical
addresses for only the specified computer are displayed. If
more than one network interface uses ARP, entries for each ARP
table are displayed.
-g Same as -a.
inet_addr Specifies an internet address.
-N if_addr Displays the ARP entries for the network interface specified
by if_addr.
-d Deletes the host specified by inet_addr. inet_addr may be
wildcarded with * to delete all hosts.
-s Adds the host and associates the Internet address inet_addr
with the Physical address eth_addr. The Physical address is
given as 6 hexadecimal bytes separated by hyphens. The entry
is permanent.
eth_addr Specifies a physical address.
if_addr If present, this specifies the Internet address of the
interface whose address translation table should be modified.
If not present, the first applicable interface will be used.
Example:
> arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.
> arp -a .... Displays the arp table.
 
Thanks.

I have another Question.

When I ping a computer on the same subnet that I am I get the replys with no problem . Then I do arp -a and it gives me the MAC address just fine.

Is there a way to do that on a computer that is on another subnet ?
 
this is what happens when you cross subnets host1 is trying to contact host4.

An application generates an IP packet for Host4, a machine on
a different subnet

Packet for Host 4 is passed to the LAN Driver

Host1 is not aware that Host4 is on a different subnet, it
assumes that Host4 is on the same physical network. Thus it
sends out an ARP Request for Host4. This broadcast is received
by the Router

Router realizes that Host 1 thinks that Host 4 is on the same
physical network. (That's why it is attempting to use ARP).

Router recognizes the Host 4 machine as connected to Subnet2.
Thus it sends an ARP Reply indicating that its own MAC
address should be used to send packets to Host 4


An application generates another IP packet for Host4

As a result of the ARP reply, the ARP Cache maps Host 4 IP
address to Routers MAC address. Thus the packet is forwarded
to the Router

Router routes the packet to Host 4 on a different subnet


from http://www.eventhelix.com/RealTimeMantra/Networking/Arp.pdf proxy arp section
 
sooooo no, if you ping across the subnet you'll get the mac of the router. but if you can get terminal access to the router, you should be able to view its arp tables
 
Status
Not open for further replies.
Back
Top Bottom