Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-20-2010, 03:36 AM   #1
LQ Newbie
Registered: Sep 2010
Posts: 2

Rep: Reputation: 0
Squid Configuration for Centos 5.5

I want to set up a squid on our network, our dhcp server and dns are built in windows os. Can you help me to intergrate if i will be built a squid server in centos 5.5.
Old 09-20-2010, 04:43 AM   #2
Senior Member
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Thumbs up


There are two options in Squid:

1.Configure Squid Server and set browser(firefox,internet explorer)
for proxy.Disadvantage of this method is user can change the setting and he comes to know that porxy is intalled in network.

2.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


# yum install squid
Open file
# 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
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 webbrowser > Tools > Internet option > Network settings > and setup Squid server IP address and port # 3128.

For firefox

goto Edit-->Prefernces-->Advanced-->Network-->Setting--> and setup Squid server IP address and port # 3128

2.Transparent Squid:

# vi /etc/squid/squid.conf
Modify 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
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:
iii) Eth1: IP: ( 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
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

Last edited by prayag_pjs; 09-20-2010 at 04:53 AM.
1 members found this post helpful.
Old 09-20-2010, 04:47 AM   #3
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Have your tried to search LQ for the same. You should be able to find howtos on squid configuration on LQ as well as google. And then if you have any special issues you can ask them.
Start off here:
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Centos 5.2 squid problem AGAIN struggled_newbie Linux - Newbie 5 09-08-2010 11:59 PM
Problem with configuration of Squid server behind a squid ajitup Linux - Server 13 08-12-2009 10:55 PM
WHich squid for CentOS? qwertyjjj Linux - Server 12 08-04-2009 10:52 AM
squid error on centos 5 ssilayaraja Linux - Networking 1 03-26-2008 04:13 AM
Squid: special configuration for remote Squid server hamish Linux - Software 0 12-06-2005 03:58 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration