0

How can I capture the MAC address (hardware address) of any access point in Java?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
mrutyunjay
  • 6,850
  • 7
  • 25
  • 35
  • go through this[http://stackoverflow.com/questions/1333344/how-do-i-get-the-hosts-mac-address-using-java-5] – Java Mar 12 '12 at 05:28

1 Answers1

2

If you have multiple access point and you know ip-addresses of these point than you can do

InetAddress add = InetAddress.getByName("enter ip here");
NetworkInterface ni = NetworkInterface.getByInetAddress(add); 

Take a look at NetworkInterface.getHardwareAddress() method of NetworkInterface class in java. It returns

Returns the hardware address (usually MAC) of the interface if it has one and if it can be accessed given the current privileges.

RanRag
  • 48,359
  • 38
  • 114
  • 167