Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

We have RHEL 5.0 squid proxy in our office.

Our LAN is 172.20.12.0 /24 n/w. Proxy ip is 172.20.12.4 /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 172.20.12.4/24 traffic is allowed and all other (except 172.20.12.8 and 172.20.12.9) 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.

1 Answer 1

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 172.20.12.4 which somehow has Internet connection) and you want 172.20.12.0/24 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 172.20.12.0/24 -j ACCECPT
iptables -A INPUT -j SQUID
service iptables save

PS

Assuming 172.20.12.4 has conncection to the Internet there should be some NAT configuration on the router leading to the Internet as 172.20.12.4 is not routable on the internet. It is likely that other hosts on 172.20.12.0/24 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 or ask your own question.