Super User is a question and answer site for computer enthusiasts and power users. 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

This question already has an answer here:

We have RHEL 5.0 squid proxy in our office.

Our LAN is /24 n/w. Proxy ip is /24 .

I want to share Internet through proxy.

Most importantly:

Suppose I have flushed the iptables, can you tell me what is the procedure from starting to configure iptables.

Keeping in mind that only traffic is allowed and all other (except and should be blocked from my LAN. And all users browsers should have proxy address to get Internet failing to give proxy should not get Internet.

share|improve this question

marked as duplicate by Sathya Apr 12 '13 at 9:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

On RHEL 5 run system-config-securitylevel or system-config-securitylevel-tui to get some basic firewall rules.

Check if you're happy with them:

iptables -L -n -v

Your exact requirements are not very clear. But assuming you are usings Squid's default HTTP port 3129 (on which somehow has Internet connection) and you want to access Squid, add this after you set up basic blocking with system-config-securitylevel:

iptables -N SQUID
iptables -A SQUID -p tcp --dport 3129 --source -j ACCECPT
iptables -A INPUT -j SQUID
service iptables save


Assuming has conncection to the Internet there should be some NAT configuration on the router leading to the Internet as is not routable on the internet. It is likely that other hosts on could use this NAT too and have no need to use the proxy. If you don't want them to use NAT you have to accomplish that on the NAT router.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .