How would I whitelist a specific URL with iptables? Currently all requests are blocked.

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

I need to whitelist just this URL so that my captive portal does not trigger the Captive Network Assistant on the iPad. Ideally still blocking requests to www.apple.com.

Additionally, is there a way to make the rule specific to a certain User-Agent?



You need a HTTP proxy. It is impossible to do this with iptables only.

Block access to all HTTP hosts (except of your proxy) with iptables, for all except of the proxy. Then configure the proxy to allow or deny specific URLs.

  • Note that you can block to all except of the proxy using uid-owner feature of iptables. – porton Feb 27 '13 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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