LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-10-2012, 04:23 AM   #1
reetika786
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Rep: Reputation: Disabled
Squid configuration


I am new to linux just installed squid on centos but I cant access any website after adding squid IP My configuration is as follows:

OS :Cent Os
Eth0 =172.16.0.16
Eth1=172.16.0.7

etho is connected to internet and eth1 to lan. my config file have entries as follows

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
icp_access allow all
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid/access.log squid
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
coredump_dir /var/spool/squid
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl mylan src 172.16.0.0/24
http_access allow localhost
http_access allow mylan


Iptables as:

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to 172.16.0.16:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128


I am testing this configuration as adding ip 172.16.0.7 as my gateway in windows xp pc but cant access any site or internet

Please suggest

Last edited by reetika786; 03-10-2012 at 04:25 AM.
 
Old 03-10-2012, 04:34 AM   #2
mrhokibanget
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Rep: Reputation: Disabled
try put

acl mylan src 172.16.0.0/24
http_access allow localhost
http_access allow mylan

before

http_access deny all

i hope it can help
 
Old 03-10-2012, 05:33 AM   #3
reetika786
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I tried but its not working . Can i use same ip range for both eth0 and eth1?? I doubt may be this is the reason i cant access.
 
Old 03-10-2012, 06:39 AM   #4
mrhokibanget
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Rep: Reputation: Disabled
try put this command :

tcp_outgoing_address 172.16.0.16 mylan
dns_nameservers your-dns-number

or u can use different ip range for both eth0 and eth1
and try command above but change ip 172.16.0.16 to ur new ip address

i hope its can help

Last edited by mrhokibanget; 03-10-2012 at 06:46 AM.
 
Old 03-10-2012, 06:46 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Does the connection work without the proxy?
Can you ping the outside?

Kind regards
 
Old 03-10-2012, 07:00 AM   #6
reetika786
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
yep without proxy i i can ping both ip i.e 172.16.0.16 and 172.16.0.7. please help
 
1 members found this post helpful.
Old 03-10-2012, 09:12 PM   #7
mandyapenguin
Member
 
Registered: Nov 2011
Location: India
Distribution: RedHat, Cent OS, Fedora, Debian, Ubuntu
Posts: 106

Rep: Reputation: Disabled
Hi..reetika786.
This can help you.
 
  


Reply



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
Squid configuration Amey Khot Linux Mint 4 11-18-2011 01:56 AM
squid configuration israr Linux - Software 2 02-25-2010 11:22 AM
Problem with configuration of Squid server behind a squid ajitup Linux - Server 13 08-12-2009 10:55 PM
squid configuration er.pankajg General 3 03-13-2006 12:55 AM
Squid: special configuration for remote Squid server hamish Linux - Software 0 12-06-2005 03:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:00 PM.

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