Wednesday, September 26, 2012

Disable Captive Network Support in OS X

iOS4+ and OS X (10.7+) Devices have a feature called Captive Network Support, which when you connect to an access point tries to download:

http://www.apple.com/library/test/success.html

to see if the device is connected to the internet. If it doesn't get the success response it assumes you are behind a captive portal and pops a webkit window so you can do the portal dance.  This is mostly useful if you are using thick-client apps, since if you're using a browser you're going to see the portal page as soon as you go anywhere.

To disable it, set this preference:

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control Active -boolean false

10 comments:

B said...

In case, you would ever want to remove this setting, you can do

sudo defaults delete /Library/Preferences/SystemConfiguration/com.apple.captive.control Active

Thanks for the post!

man9ar00 said...

Thanks for sharing. Curious, did you mean this is useful for "thick" or "thin" clients? Because both typically offer a browser app to go online.

I do agree and find this a terrible idea to have a custom popup app for this when the Mac could just fire up default browser and let the wifi connection redirect to the captive portal. That's how Windows does it.

G said...

@man9ar00 The intent behind the functionality is to save you the frustration of wondering why your mail (or whatever other program that connects to the internet but won't render a captive portal page) isn't showing working even though you're connected to WiFi. That's what I meant by "thick" client.

Anonymous said...

where could I use this sudo code? Can any1 explain? Pls

Colin R said...

@Anonymous: enter it in Terminal. See e.g. http://osxdaily.com/2012/10/09/best-defaults-write-commands-mac-os-x/ for more information.

Julian said...

I tried this on El Capitan and the capitve portal still appeared. Do I have to restart something perhaps?

BhanuPrakash said...

in my macbook i didn't find this file /Library/Preferences/SystemConfiguration/com.apple.captive.control plz suggest any solution.....

Unknown said...

Is there any new tip about how to disable The CNN on El Capitan

Sanjay Aiyagari said...

This really works - it's not a file it's a preference

Alireza said...

After setting the preference and restarting the Mac it works and the CNA doesn't pop up. But after trying to delete the preference as @B suggested the CNA is still inactive i.e. doesn't pop up when connected to a network. So how should I get the CNA back?