Friday, January 28, 2011
Squid Proxy Server Installation Guide on CentOS 5.5
6:15 AM |
Posted by
Mark Gagalac |
Edit Post
There are two options in Squid:
- Configure Squid Server and set browser(firefox,internet explorer,chrome) for proxy.Disadvantage of this method is user can change the setting and he comes to know that porxy is intalled in network.
- Transparent Squid: Benefit of setting transparent proxy is you do not have to setup up individual browsers to work with proxies.
Disable iptables and selinux
system-config-selinux
system-config-firewall
yum install squid
vi /etc/squid/squid.conf
make the follow changes in file (you may need to search for these lines and uncomment it ) (change the network which suits your environment)
acl our_networks src 192.168.1.0/24 192.168.2.0/24
http_access allow our_networks
Start the squid server
chkconfig squid on
/etc/init.d/squid start
To verify Squid service is running and port 3128 on which squid by default runs use:
netstat -tulpn | grep 3128
Client configuration:
Open a web browser > Tools > Internet option > Network settings > and setup Squid server IP address and port # 3128.
For Mozilla Firefox
goto Edit-->Prefernces-->Advanced-->Network-->Setting--> and setup Squid server IP address and port # 3128
Transparent Squid:
vi /etc/squid/squid.confModify or add following squid directives:
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl lan src 192.168.1.1 192.168.2.0/24
http_access allow localhost
http_access allow lan
Restart the squid
/etc/init.d/squid restart
chkconfig squid on
Now we will add the iptables rules to redirect port 80 http request to port 3128
For that keep in mind that we need following setup
Eth0: IP:192.168.1.1
iii) Eth1: IP: 192.168.2.1 (192.168.2.0/24 network
add following rules to forward all http requests (coming to port 80) to the Squid server port 3128 :
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.1:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
Subscribe to:
Post Comments (Atom)
Labels
- adtran (1)
- apps (1)
- cctv (1)
- dhcp (1)
- firewall (1)
- gpo (1)
- hyper-v (2)
- linksys (1)
- linux (7)
- pfSense (1)
- phones (1)
- portable (1)
- proxy servers (2)
- remote desktop (1)
- routers (1)
- sip (1)
- squid (2)
- systems and network (19)
- telnet (1)
- terminal services (1)
- virtualization (3)
- vmware (1)
- vpn (2)
- webmin (1)
- windows (11)
- windows 7 (2)
- windows server 2003 (1)
- windows server 2008 (2)
- windows xp (1)
1 comments:
I like your article it wordpress installation service is very nice would like to
access Mp3Raid in UK
Post a Comment