mrutyunjay
mrutyunjay

Reputation: 8270

How to get MAC address of Access point in java?

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

Upvotes: 0

Views: 1137

Answers (1)

RanRag
RanRag

Reputation: 49547

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.

Upvotes: 2

Related Questions