How do I leave a WiFi network on OS X without turning AirPort off?

2

1

I'm unable to find info on how to use networksetup or some other tool on OS X that will allow me to disassociate/leave a WiFi network without turning off AirPort or removing the preferred networks list.

When the Mac hasn't joined any networks but WiFi is on, it is precisely in this state, but I need to know how to trigger this on the command line.

Martin Naskovski

Posted 2012-02-09T20:44:03.740

Reputation: 21

Answers

3

Apple includes a command line utility to change AirPort settings, called airport.

sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z

The -z option will disassociate from any network. If you use that command often, you can link it to a directory that's in your PATH, for example /usr/bin.

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/bin/airport

After this, you'll only have to call:

airport

uselpa

Posted 2012-02-09T20:44:03.740

Reputation: