Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a machine with Linux Slackware 13.37. Is it possible to configure iptables, so the users will be able to access web only through squid? The direct access through the browser will be blocked.

Cause I don't want them to visit certain sites.

share|improve this question

Yes, but you will need to setup a white list of allowed connection,

Set default out going policy to drop, and only allow access to a specific port / server, i.e

iptables -P OUTPUT DROP
iptables -A OUTPUT -p tcp --dport XX -d YY -j ACCEPT
... ( your other rules )

That way user must configure their browser to utilize YY:XX as the proxy server.

share|improve this answer
What to do when squid and browser reside on the same machine? – user4035 Mar 5 '13 at 14:28

Your Answer


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.