10

This question already has an answer here:

How can I find out what the MAC address (BSSID) of the wireless access point I'm connected to is?

marked as duplicate by Seth Apr 27 '15 at 3:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Though this question has been marked as a duplicate, the accepted answer here is what gave me the info I needed. The highest ranked answer on the linked question gives me more info than I need, which didn't let me figure out which of the two MAC addresses my printer was listing belonged to the SSID my laptop is connected to. If there's ever a cleanup of duplicates, perhaps the answers can be merged? – hlongmore Mar 3 at 9:03
18

Any of these 3 works:

  • arping 192.168.0.1 Change the IP adress to whatever you use. The MAC address is in the reply between brackets.

  • iwconfig | grep "Access Point". Access point will be colored and behind it the MAC address.

  • iwlist wlan0 scan | grep Address same as previous command (color etc).

  • iwlist wlan0 scan|grep worked, thank you a lot :) – gro Nov 27 '12 at 13:17
  • The iwlist option gives me a message saying the interface doesn't support scanning; the arping option gives me what is probably a cached version of the wired connection I unplugged. Happily, the iwconfig option gives me the info I needed. – hlongmore Mar 3 at 8:51
9

If you are using a recent desktop version of Ubuntu (with interfaces managed by network-manager) then nmcli is a more configurable option than nm-tool. For example, to list some common information including SSID, access point MAC (BSSID), channel frequency, signal strength etc. for all the access points seen by the active wifi device you can use

nmcli dev wifi list 

You can limit the output to specific fields e.g. to see just the access point MAC addresses (BSSIDs) and connection status, use

nmcli -f BSSID,ACTIVE dev wifi list

To return just the MAC address to which the wifi device is currently connected (i.e. the access point whose ACTIVE field is 'yes'), you can use

nmcli -f BSSID,ACTIVE dev wifi list | awk '$2 ~ /yes/ {print $1}'

Not the answer you're looking for? Browse other questions tagged or ask your own question.