Hardware address client

If we all are in the same network then why cannot we get the MAC address of the client ?. NetworkInterface.getHardwareAddress gives the machine hardware address not the client which connects to the server. Anyone with any suggestions ?

Even if you are on the same physical network, network policies and/or routing across subnets can make this (practically) impossible. As far as I'm aware, there is no "reliable" way to retrieve the MAC address of a remote network device short of having a way to send a command to a process running on the remote PC, or implementing discovery calls to the switch (i.e. via CDP for Cisco switches).

If within the same subnet and barring any network policies or configuration preventing it, you may be able to lookup the IP of the remote PC in the ARP table, then grab the MAC address from that. However, this is not guaranteed to work, and may actually give wrong information (i.e. if switching or routing is performed it may return the MAC of the switch/router).

Good article. That gives me an idea that it is impossible to get the MAC address of the client in java even it is connected on the same network. The only way is to run the Process Runtime.exec() command and give arp as a parameter and then compare the client ip with the ip we got from running the arp command in java and then parse the mac address.

Featured Post

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench.
Introduction
While learning Java can be done with…

Introduction
Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…