airport – the Little Known Command Line Wireless Utility for Mac
Hidden from the casual Mac user is a spiffy command line utility that allows you to view, configure, and troubleshoot your Mac’s wireless connection, entirely from the Terminal of MacOS and Mac OS X. This command has a help file but is otherwise but not much documentation, and judging by the obscure location of the command, Apple probably didn’t think it would be too useful for the average Mac user. But the hidden command line airport tool is very useful indeed, particularly for more advanced Mac users who want to have full control over their wi-fi hardware directly from the command line in Mac OS X.
With that in mind, here is how to access the amazingly useful yet little-known airport tool, and how you can use it for some networking tasks too.
How to Access & Use airport Command Line Tool on Mac OS
In case you were wondering, yes the command line airport tool exists in nearly all versions of Mac OS X, even modern versions that stopped calling wireless networking ‘airport’ and refer to it as Wi-Fi. OK let’s begin.
First, Get Easier Access to airport Wi-Fi Tool
The first thing you’ll want to do is create a symbolic link to the airport command, because it is situated in a very inconvenient location with a deep path, this helps for quick usage. Creating a symbolic link to airport is very easy, in the Terminal type the following:
For MacOS Mojave, Catalina, Big Sur, and newer MacOS releases
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport
For Mac OS X High Sierra, Sierra, El Capitan, Mavericks, and earlier
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
The above may be a bit hard to read on some browsers, so alternatively you can use the following (it does the same thing, just split into two commands):
For Mac OS Catalina, Mojave, and newer macOS versions
$ cd /usr/local/bin/
$ sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
For Mac OS X High Sierra, Sierra, El Capitan, Mavericks, and earlier
$ cd /usr/sbin
$ sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
Note the only difference between modern macOS versions and prior versions is where you will be placing the symbolic link, which is in /usr/local/bin/ versus in /usr/sbin/
Whichever method you go with, the sudo command will prompt you for a root password, enter it and hit return.
Yes, that giant cryptic path through the depths of Mac OS X is where Apple hid the wonderful airport utility, but by running the above command you have just linked that long path to the much shorter ‘airport’ , which is great.
Using the airport Wireless Tool in Mac OS X Command Line
Now that you have quick and easy access to airport with the above symbolic link, you can start using the airport tool.
For starters, you’ll probably find the -I flag and -s flags to be most useful and informative.
For example, with airport -s you will effectively have a wi-fi router stumbler and get a list of available wireless networks complete with their SSID, BSSID hardware address, security encryption type, and channel.
airport -s
You can also use airport -I at the Terminal prompt, which will return information specific to the current wi-fi connection, looking something like the following:
$ airport -I
commQuality: 75
rawQuality: 59
avgSignalLevel: -40
avgNoiseLevel: -97
linkStatus: ESS
portType: Client
lastTxRate: 11
maxRate: 11
lastAssocStatus: 1
BSSID: 00:06:5b:2a:37:10
SSID: OSXNetwork
Security: none
$
Displayed is detailed information on wireless signal quality, noise, security, and other WiFi network attributes.
The airport command is more powerful than just being able to list information on the current wireless network though, you can actually manually adjust any wi-fi settings, network card settings, troubleshoot networks, change security types used on a connection, capture packets into a pcap file, join and leae networks, disassociate from a wifi network, prioritize routers and networks, see signal strength and interference, adjust wi-fi hardware drivers, and perform a huge variety of network troubleshooting functions too. This is easily one of the most powerful ways to interact with a wireless card on a Mac.
While there is no manual page for the airport command, attaching the -h or –help flag to the command to will issue a brief list of flags and explanations of their function. You can also just run ‘airport’ at the Mac OS X command line to get the full help file, shown below:
$ airport
Usage: airport [interface] [verb] [options][interface]
If an interface is not specified, airport will use the first AirPort interface on the system.[verb is one of the following:
prefs If specified with no key value pairs, displays a subset of AirPort preferences for
the specified interface.Preferences may be configured using key=value syntax. Keys and possible values are specified below.
Boolean settings may be configured using ‘YES’ and ‘NO’.DisconnectOnLogout (Boolean)
JoinMode (String)
Automatic
Preferred
Ranked
Recent
Strongest
JoinModeFallback (String)
Prompt
JoinOpen
KeepLooking
DoNothing
RememberRecentNetworks (Boolean)
RequireAdmin (Boolean)
RequireAdminIBSS (Boolean)
RequireAdminNetworkChange (Boolean)
RequireAdminPowerToggle (Boolean)
WoWEnabled (Boolean)logger Monitor the driver’s logging facility.
sniff If a channel number is specified, airportd will attempt to configure the interface
to use that channel before it begins sniffing 802.11 frames. Captures files are saved to /tmp.
Requires super user privileges.debug Enable debug logging. A debug log setting may be enabled by prefixing it with a ‘+’, and disabled
by prefixing it with a ‘-‘.AirPort Userland Debug Flags
DriverDiscovery
DriverEvent
Info
SystemConfiguration
UserEvent
PreferredNetworks
AutoJoin
IPC
Scan
802.1x
Assoc
Keychain
RSNAuth
WoW
P2P
Roam
BTCoex
AllUserland – Enable/Disable all userland debug flagsAirPort Driver Common Flags
DriverInfo
DriverError
DriverWPA
DriverScan
AllDriver – Enable/Disable all driver debug flagsAirPort Driver Vendor Flags
VendorAssoc
VendorConnection
AllVendor – Enable/Disable all vendor debug flagsAirPort Global Flags
LogFile – Save all AirPort logs to /var/log/wifi.log[options] is one of the following:
No options currently defined.Examples:
Configuring preferences (requires admin privileges)
sudo airport en1 prefs JoinMode=Preferred RememberRecentNetworks=NO RequireAdmin=YESSniffing on channel 1:
airport en1 sniff 1LEGACY COMMANDS:
Supported arguments:
-c[[arg]] –channel=[[arg]] Set arbitrary channel on the card
-z –disassociate Disassociate from any network
-I –getinfo Print current wireless status, e.g. signal info, BSSID, port type etc.
-s[[arg]] –scan=[[arg]] Perform a wireless broadcast scan.
Will perform a directed scan if the optional [arg] is provided
-x –xml Print info as XML
-P –psk Create PSK from specified pass phrase and SSID.
The following additional arguments must be specified with this command:
–password=[arg] Specify a WPA password
–ssid=[arg] Specify SSID when creating a PSK
-h –help Show this help
As you can see, there is an abundance of options to interact with wireless networks by using the airport utility in Mac OS X. Advanced Mac users should really get a kick out of this one, as it’s extremely powerful, and wildly useful.
You can also do some pretty interesting things with airport. For a few examples, you can test wireless signal strength live from the command line with airport. Another example will list available wi-fi routers by name only that are nearby, sorted by signal strength (thanks to @jacobiun for this) but omitting BSSID and other data:
airport -s | tail -n +1 | sed 's/ [a-z0-9][a-z0-9]:/,&:/g' | sed 's/ -/, -/g' | cut -d ',' -f1,3 | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//' | grep -v "SSID" | sed 's/ /,/g' | cut -d ',' -f1,2 | sort -t ',' -k 2
The next time you’re working on any wi-fi related task or wireless networking in general, remember the awesome airport tool.
Since Sonoma 14.4 this command is deprecated gettin the next message:
WARNING: The airport command line tool is deprecated and will be removed in a future release.
For diagnosing Wi-Fi related issues, use the Wireless Diagnostics app or wdutil command line tool.
I don’t know what I’m doing wrong, but I get this message:
ln: usr/local/bin/airport: No such file or directory
??
Any insight appreciated
Make sure you enter the syntax exactly as written. Looks like you’re missing a / in front of /usr when running the command
The first command simply links (like an alias) the buried airport command to /usr/local/bin/airport
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport
This allows you to then simply type ‘airport’ to run the command
I don’t know what I’m doing wrong, but I get
ln: /usr/local/bin/airport: No such file or directory
??
I’m trying to do this but I get this error:
“(user) is not in the sudoers file. This incident will be reported.”
I’m logged into my Mac as the admin, so this should not be happening. (Assuming my password is the computer’s password, not my Apple ID password.)
macOS 10.14.6 latest updates…did some security update mess something up here?
sudo airport en1 sniff 8
Capturing 802.11 frames on en1.
Segmentation fault: 11
I’m Chinese and I don’t speak English very well. My problem is that I can’t grab the packet as above, and I didn’t give this error message back for a long time.
thanks。
This airport command is so great, I use it all the time in the Terminal of MacOS Mojave for most networking tasks. Thanks.
how to connect wpa2-enterprise security wlan using airport utility
what does it mean to disassociate (-z) from a network?
i can’t quite find enough explanations on this
Disassociating from a network disconnects from that network and loses any associations to it, but it does not turn off general wi-fi. Hope that makes sense!
Can someone figure out how to do this on Sierra.
The airport command continues to work in MacOS and Sierra, if you are having difficulties with the soft link you can also add an alias to the .bash_profile like so:
alias airport='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport'
This is macOS System Integrity Protection (SIP) which prevents even root from changing things in /System, /usr, /bin, /sbin and pre-installed Apps.
An exception in /usr is that /usr/local can be written.
so try this
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport
this works fine in Sierra
On El Capitan the path is /usr/local/bin/airport
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport
I did it in the two ways and i couldn’t:
ln: ./airport: Operation not permitted
i´ve tried to do it with the superuser and dose not works =/
someone can help?
thanks
Hi,Did you use OSX 10.11?
See”https://en.wikipedia.org/wiki/System_Integrity_Protection”,you can not write /usr/ ,but not /usr/local.
So,try this:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/sbin/airport
Thanks It works
instead of linking the file into /usr/sbin like you suggested, you can also add the following line to your .profile (% nano .profile):
alias airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
Wonder if there’s any counter part on IOS(8 meanwhile).
Any ideas?
Best
Does anyone know a command to remove a client wireless from my network? For example an iPhone from somebody that use my network wireless. Thanks for help
[…] Networking is pretty straightforward, and has its own command line utility, airport. […]
[…] long hidden airport command line utility buried deep in Mac OS X can be used to scan for and find available wireless […]
does anyone know a way to lock my wifi card of my macbook air to use (a) only ?
on my PC I can change the driver settings of my wifi card to use 5.2ghz only and i would love to be able to the same on my mac.
I want to do this because at my work there are multiple repeaters.
Awesome tipp :)
Note that at least on 10.6, many airport infos are available when clicking on regular menubar airport icon with “Alt” key pressed.
One of the many eastern egg embedded by Apple through ages!
[…] OS X comes with a nifty little known command line wireless utility. To enable easy access to it, run the following to put it in the command line’s search path: […]
This is freakin’ awesome. Thanks for finding and posting this. I wish I had known about this sooner.
[…] osxdaily hat auch noch diese Zeile hier zum Besten gegeben, um einen einfacheren Aufruf zu gewährleisten: sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport Danach kennt das Terminal ein airport-Kommando =) […]
[…] command) that would let me see which AP I had associated with. After some digging around I found this webpage that told me that there is indeed a command (very well hidden) right there in the OS. For some […]
Once again, Mac’s needlessly restrictive and retarded ‘Think Different’ meets up with BSD’s obsessive ‘stability’ and buries the command to print wireless info behind, what, seven directories? Why is ifconfig in $PATH but ‘airport’ (seriously? seriously? does the wireless make the computer fly? WTF?) is not? Why is ssh in $PATH but airport isn’t? Why is it that people smart enough to design with global menus, autohiding docks, multi-touchpads and the best laptop shell (the case, not the UI) ever don’t realize that wireless access is almost a necessity for enterprise and personal computer use in this day and age and that, silly me, I thought that it would be ‘faster’ to use a terminal than GUI to learn my wife’s work machine’s MAC address so we could fix the damn network.
Of course, I realize the answer to my question is “because designers make terrible engineers and engineers make even worse designers” but I, like, thought they ‘Think Different’ out in Cupertino.
Great Tips,
Thanks man
[…] Kriesel benutzt. Um an die W-Lan Daten zu kommen habe ich (da ich ein Macbook benutze) den Befehl „airport -s“ mit dem ProcessBuilder verwendet weil Java diese Funktion leider nicht zur Verfügung stellt. […]
[…] else is really valuable. Here’s a way you can do this through the command line using the airport wireless tool we’ve discussed in the […]
Since Snow Leopard you need to use the networksetup command to connect to a wireless network from the command line.
Like this :
sudo networksetup -setairportnetwork en1 SSID PASSWORD
THANK YOU!!!
I’ve been pulling my hair out trying to figure out why ‘sudo airport -associate’ or any of the other similar commands haven’t been working for me, and haven’t been able to find Snow Leopard stuff anywhere else.
I’m using lion and couldn’t get this or the -A to work, any ideas?
Does anybody know how to connect to a specific ssid with the airport command ? It seems that in snow leopard the parameter “-A –associate” is no longer available…what else can be used to connect to a certain ssid by command line?? thks
Just in case nobody know, but, most of the info you can get with this little command line util is available by simply holding down the ALT key on your keyboard before you click on the little wifi symbol in the top screen bar (on the right).
By pressing ALT, it will revel a lot more information that the signal level, pretty much the same thing you get with #airport -I.
There are lots of stuff like that hidden away in OSX. The principle as I see it is that most people don’t need to know that, so they hide it, but for power user, it’s usually as easy as holding down a key (usually ALT) before clicking on a lot of things to revel more advanced option.
I guess, it would be nice to have an advanced options on/off switch somewhere in the system preferences for people who want to see all the available options.
There you go!
where the hell is the alt button on a mac :P
option=ALT
[…] rate 2MB, en windows hay que modificar el valor en las propiedades del adaptador y en os x? airport – the Little Known Command Line Wireless Utility – OS X Daily Juegue 8) […]
I’m having the same problem as Ryan (above), i can’t seem to get it to connect to one of multiple same-SSIDed routers using the BSSID. Anyone figure this out?
[…] airport – the Little Known Command Line Wireless Utility […]
This tip has ended hours of pulling my hair out. I’d been having trouble with my Mac mini computer automatically joining random wireless networks rather than the *one* network I’d ever want it to join … and this is despite using Network Preferences to configure Airport to join only preferred networks by default; to ask before joining an open network; and to require an admin password to change wireless networks.
Another good command line:
Did you ever fart so hard you ended up in another zip code?
Is there any way to turn up the roaming aggressiveness of the airport card? We have many APs here, but the airport card doesn’t always connect to the closest one, especially after moving around the office…
Nice CLI command….thanks.
But we are protected by WPA2-Enterprise (so Radius in the back) So we have DOT1.x user and pass configure in the GUI for our WIFI connection.
Is there a way to pass those informations by giving specifics arguments to the command airport.
you can hold down the option key when clicking on the airport menu to get some of the more useful troubleshooting info.
[…] the Airport, called “airport”. Only its buried pretty deep in the system. Visit this article to find out more. I’ll show you how to add this to your PATH to make sure its always available. We can use […]
Sorry for the 2nd post— more info – I CAN change and add associations to wireless networks on ppc and intel platform as long as they are not encrypted. Our change is going from unencrypted closed network to a wpa2 closed network. If I can make this work I can send remote commands with the security software we use on the Macs.
I can’t make this work on PPC computers running 10.4.11 only on intel 10.4.11 – here is the command I have been using
airport -A –associate= –password=
This is important to me because my network manager is changing our wireless security on 15 campuses and I need to make all the wireless macs change over…about 1000 G4 iBooks. Any ideas as to why the intel and ppc 10.4 computers act differently with the same command?
[…] is not readily accessible. We make it that way with the following command in Terminal (found here): sudo ln -s […]
Thank you very much for the useful tips
You have really saved my time .
Since I have bought my new macbook, I have had a lot of difficulties to configure my wireless network settings.
My laptop was automatically joining my neighbour’s network rather than the network I’d ever want it to join.
That was bothering for me and I intended to bring it bag to the shop, but the laptop has a very nice design, That’s why I haven’t done it.
í•œìŠ¤ì˜ ìƒê°…
airport – the Little Known Command Line Wireless Utility ì—ì–´í¬íŠ¸ ìƒíƒœë¥¼ 커맨드ë¼ì¸ìœ¼ë¡œ 확ì¸í•´ì•¼ í• ë•Œâ€¦…
Does anyone know if there is a command switch to tell the NIC to run 20/40mhz? Network Utility displays 130 and that means the NIC is not set to 20/40. I wish there were a configuration utility to set these parameters like in Windoz. When running Bootcamp, I have no problem with wireless N settings and attain 270+ speeds. It is only a problem in OSX, which is, of course, why I have my wonderful MacBook Pro. I love my Mac, but I want more speed, and need my DIR-655 functionality.
“I have an idea..
I have an idea.. You can use an OS that doesn’t require you to and open command line utilities and terminals
and write SCRIPTS just to accomplish the simpleist everyday tasks!!”
You are implying OSX requires one to use terminal to perform some of the operations listed here.
Well OSX doesn’t require this d-bag.
I have an idea..
I have an idea.. You can use an OS that doesn’t require you to and open command line utilities and terminals
and write SCRIPTS just to accomplish the simpleist everyday tasks!!
DOH
In response to Jason’s comment:
“Unfortunately, I can’t seem to figure out how to connect to SSIDs that are not broadcasted. Anyone have an idea?”
Try this syntax instead:
$ sudo airport -A –ssid=ESSID –password=PASSWORD
it worked for me.
For spoofing mac you could try (tested on OS X 10.5.6):
$ airport -z #optionally disconnect from network to hide your mac change
$ sudo ifconfig en1 ether AA:BB:CC:DD:EE:FF #this can only be done when the interface is up (or at least from my experience)
$ sudo airport -A –ssid=ESSID –password=PASSWORD #reconnect to network.
Now the airport GUI will tell you your original mac address still, but when you are connected if you check output from ifconfig:
$ ifconfig en1 ether|grep ether
ether AA:BB:CC:DD:EE:FF
similarly, if you have admin access to the router you can check the connected devices there and see your mac should have changed.
[…] osxdaily.com /usr/bin/sudo /bin/ln -s […]
[…] Re: Gestione airport da terminale On 15 Mag, 23:56, Massimo <rana…@gmail.com> wrote: Ti posto un sito di interesse https://osxdaily.com/2007/01/18/airpo…eless-utility/ ciao « aggiungere capitoli | Gli utenti windows » […]
[…] Handy little wireless command line command. […]
macbook:Resources root# airport -h
airport AirPort v.522.4 (522.4.0)
Supported arguments:
-z –disassociate Disassociate from any network
-i[] –ibss=[] Create IBSS
-x –xml Print info as XML
-s[] –scan=[] Perform a wireless broadcast scan.
Will perform a directed scan if the optional is provided
-r –repeats= Repeat the command the specified number of times
-A[] –associate=[] Associate to network.
Will prompt for network name if arg is not specified
and if necessary, for a password if the network is using WEP or WPA.
The following additional arguments may be specified with this command:
–bssid= Specify BSSID to associate with
–password= Specify a WEP key or WPA password
-I –getinfo Print current wireless status, e.g. signal info, BSSID, port type etc.
-P –psk= Create PSK from specified pass phrase and SSID.
The following additional arguments must be specified with this command:
–ssid= Specify SSID when creating a PSK
-c[] –channel=[] Set arbitrary channel on the card
-h –help Show this help
macbook:Resources root#
[…]   My MacBook usually didn’t feel like reconnecting to my AirPort after waking up from sleep mode. I’ve finally been able to solve that problem usingthe aiport command line utility and SleepWatcher. Simply installed SleepWatcher, and created the following little script in~/.wakeup: […]
You can add some code to automatically connect you the the SSID you like.
$sudo airport -A –associate=SSID –password=PASSWORD
Unfortunately, I can’t seem to figure out how to connect to SSIDs that are not broadcasted. Anyone have an idea?
If you know the SSID name (even if it is not broadcasted) you can see in which devices is: airport -s namenobroadcasted
if you are just trying to disconnect your connection
$airport -z
to scan for available networks
$airport -s
to join you need root access
$sudo airport -A
you will then be prompted for the SSID you’d like to join.
Great find, thanks for sharing.
I’m having the same problem as Ryan (above), i can’t seem to get it to connect to one of multiple same-SSIDed routers using the BSSID. Anyone figure this out?
10.4
[…] The Little Known Command Line Wireless Utility […]
[…] via: airport – the Little Known Command Line Wireless Utility – OS X Daily Search […]
[…] Next I remembered a very useful post about How to get the wireless signal strenght from you airport and I decided to put togheter my (very small) knowledges of RubyCocoa to create a script that make your mac to work as an hot spot detector. […]
Guys I really need your help ASAP :( I have this huge problem in turning my AirPort on. I cant select the Airport’s checkbox in my network port configurations and I dont know why??? I can select and deselect the rest of the ports (bluetooth, internal modem, built in ethernet, etc) but NOT the AirPort!!!!
HELP MEEEEEEEEEEEEE
Thanks
I’m looking for a way to automate the wireless configurations of hundreds of laptops in my school.
Can anyone point me to a solution?
I’m configuring the wireless using peap with mschap v2 and a certificate, all the laptops are macbooks osx 10.4
Thanks.
I have do this implementation in python to automatically reconnect to my wireless if disconnected:
import os
import time
import logging
CHECK_PERIOD_IN_SECONDS = 60
TEMPFILE = “connection-info.txt”
KEYWORD = “MyPlace”
LOGFILE = “airport-reconnect.log”
def is_connected():
# Generate connection info
os.system(“/usr/sbin/airport -I >” + TEMPFILE)
# Read connection info
f = open(TEMPFILE, “r”)
data = f.read()
f.close()
# Check
return KEYWORD in data
def connect():
os.system(“/usr/sbin/airport -a”)
logging.info(“Re-connected.”)
if __name__ == “__main__”:
# Logger
try: os.remove(LOGFILE)
except: pass
logging.basicConfig(level=logging.DEBUG,
format=’%(asctime)s %(levelname)-8s %(message)s’,
filename=LOGFILE,
filemode=’w’)
# Loop
while True:
if not is_connected():
connect()
time.sleep(CHECK_PERIOD_IN_SECONDS)
[…] As a temporary solution, I found how to re-connect from a command line, thanks to the blog article “airport – the Little Known Command Line Wireless Utility”. I’ve created the file reconnect.sh and run it when required: […]
Very nice command. Saved my day as I need to troubleshoot problems in my wireless network.
Someone please help me. I have tried to use this command to associate via BSSID and cannot get it to work. So far as I can tell, all the other commands work fine. I have several routers that have the same SSID and I need to be able to specify which one to connect to. Can someone help me?
@David
I’ve run into similar problems before with some networks that seem to have a strict policy on idling. To circumvent this, try constantly pinging a server (either on the network or outside). To do this, open your Terminal (spotlight for Terminal) and type the following:
ping google.com
instead of google.com you can use your LAN router or whatever other IP (10.1.1.1). Just let that run in the background while you’re doing things, and your connection should stay alive since small amounts of data are constantly being sent.
Hope that helps,
Paul
Thanks!
It works well
=)
Hello Paul
I would like to know if you can help me with this: I’ve been trying to hack a wp2, and I’ve been using aircrack and reaver, but using Macintosh it’s kind complicate. Do you have a manual or instructions to do it in Macintosh, just the basic -monitor mode, scan,…-. Or is just not possible? I believe that Macintosh it’s a very powerful tool to not be able to do it.
Thanks again.
Is there a way to use this utility to maintain a wireless connection? At work, I use my MacBook Pro with a wireless network (a building full of PC’s) that, when idle for very long, breaks the wireless connection, requiring logging on again. I have been unable to find a “stay connected” utilitiy for wireless like we used to have with modems.
Thanks
Hi man!
This command is very useful, but I have a question:
airport -I gives info about signal strenght with the line
avgSignalLevel: -40
I think this value is in dB.
When you type airport -s, you have the list of all networks avaiable, but which is the parameter which identifies the signal strenght? I think it could be
Sig 56
But it is in Watt or what?
Signal Strength is the “RSSI” field. It is in units of dB. Since we’re in power, when you double the signal strength you will see a 3 dB increase. Same with average signal level.
(truth: I’m guessing this is dB because all the linux driver wifi code I have seen reports that all major cards report in dB)
How do you spoof your MAC address on a PowerBook wireless card?
$ ifconfig lladdr xx:xx:xx:xx:xx
works on /dev/en0 but no luck on /dev/en1.
Still works in Leo! (That’s ‘cool’ for Leopard, Googlebots)
To actually turn airport off, you simply take the AirPort network interface down like so:
sudo ifconfig en1 down
airport -z unjoins all networks
Anyone know how to use this command line util to turn airport off?
This tip has ended hours of pulling my hair out. I’d been having trouble with my Mac mini computer automatically joining random wireless networks rather than the *one* network I’d ever want it to join … and this is despite using Network Preferences to configure Airport to join only preferred networks by default; to ask before joining an open network; and to require an admin password to change wireless networks.
I wrote a script which runs “airport -I” to notice when I’m not connected to my desired network and then to run airport –associate to rejoin. I’m using cron to run this script every few minutes, and my logs show this fixing things several times a day so far.
This also allowed me to add a StartupItem so that I can have my mini (which runs my web site, etc.) join the correct network on startup before anyone even logs in. Before I found this tip, I couldn’t find a way to get my mini to join any wireless network until I logged in.
If you could please share that script for having airport connect pre-login, that would be awesome. I need airport to be connected at login so I can access network accounts. Silly Apple.
There’s documentation available, just type:
$airport –help
Its not too informative, but there’s some info there.
Here’s another vote for “holy moly”! Now I’ll have to go dig through the system for any and all hidden executable binaries. Who knows what else is hidden?!
HOLY MOLY BEST EVER!!
Awesome! Thanks for the cool util
That’s a great tip – nice find, OSXDaily.