Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Feb 9 '12 at 21:04

This question came from our site for professional and enthusiast programmers.

1 Answer 1

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
share|improve this answer
    
Thank you slhck! Worked like a charm! –  Мартин Насковски Feb 10 '12 at 11:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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