how to get MAC address for wireless access point?
Solution 1
Either connect to the point, and do
iwconfig | grep "Access Point"
or find your access point in the output of
iwlist wlan0 scan
(if you have wireless interface called not wlan0
, substitute appropriately).
Solution 2
Use the arping
utility with your AP's IP as an argument:
$ arping 192.168.0.1 ARPING 192.168.0.1 from 192.168.0.200 eth0 Unicast reply from 192.168.0.1 [00:48:6C:38:B7:4D] 0.660ms Unicast reply from 192.168.0.1 [00:48:6C:38:B7:4D] 0.590ms Unicast reply from 192.168.0.1 [00:48:6C:38:B7:4D] 0.610ms Unicast reply from 192.168.0.1 [00:48:6C:38:B7:4D] 0.410ms Sent 4 probes (1 broadcast(s)) Received 4 response(s)
You can see the MAC address in the reply.
Solution 3
linux command
iwlist wlan0 scan
is a very good one, however if you'll have lot's of WIFI AP around (like in the multi-floor buildings) - you'll get the following error message in result:
wlan0 Failed to read scan data : Argument list too long
in this case the only way to get MAC of your AP would be:
sudo iw wlan0 scan | egrep "^BSS|SSID:" |grep -n1 <your AP name>
as an output you'll get following:
104-BSS 44:ce:7d:7b:e7:9e(on wlan0)
105: SSID: <your AP name>
where 1st line would be the MAC and 2nd line would be your AP name
on MacOSX similar information could be possible to obtain by executing:
/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -s |grep <your AP name>
as an output you'll get following:
<your AP name> 44:ce:7d:7b:e7:9e -58 1 Y -- WPA2(PSK/AES/AES)
Related videos on Youtube
Killerpixler
Updated on September 17, 2022Comments
-
Killerpixler almost 2 years
I have a sources table that has ID and Source(varchar)
1 Facebook 2 Twitter 3 Google
I have incoming data that has Source(varchar) and Views(Int)
Facebook 10 Twitter 12 Reddit 14
I want the kettle job to do this:
- Check if the source exists in the source table, and if so replace add a field of type INT called sourceID with the respective ID from source
- If it doesn't exist add it to the source table.
E.g. from the above data the result should be this
sourceID,Views 1,10 2,12 4,14 (Reddit wasn't in the table so it created it and the autoincrement gives it ID 4).
I am having trouble finding the right steps to achieve this
-
Admin over 13 yearsNot programming...
-
David Weiser over 13 years@leppie: it could be a programming question, if the asker would say, instead, "in bash, how do I..."
-
David Weiser over 13 years@MAMProgr: Do you want to know how to do this in bash, or using the GUI? If you want to use the GUI to do this, this question should be asked on su.
-
Admin over 13 years@David: The fact that it is tagged with ubuntu and not some programming platform or language pretty much excludes that hypothesis.
-
David Weiser over 13 years@leppie: doesn't the bash shell come with ubuntu? Until the asker gives more information, I don't think there's much of a onclusion that could be drawn.
-
Admin over 13 years@David: Shell scripting in such a trivial form is NOT programming.
-
so_mv over 11 yearsWonderful. Both commands show the access point MAC address.