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:

  1. 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!

    ReplyDelete
  2. 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.

    ReplyDelete
  3. @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.

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

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

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

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

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

    ReplyDelete
  9. This really works - it's not a file it's a preference

    ReplyDelete
  10. 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?

    ReplyDelete