LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-08-2005, 09:47 AM   #1
cortj
LQ Newbie
 
Registered: Feb 2003
Posts: 13

Rep: Reputation: 0
Squid firewall setup


I have set up a squid proxy and opened port 8080 because that is the port I told squid to use.
I have opened tcp 53 and udp 53 for dns.
I have required authentication and created password file and users
I am using freecap as well as my web browser to test everything.
Freecap shows me what is going on in the background if you were wondering it shows the sockets connecting and verifies the login was correct in essence it verifies the connection whereas the browsers pops up a login box and it goes away after you enter credentials .

The problem is I have a connection to the proxy but no web pages are being displayed. I do not want to run it in transparent mode so I am not sure how to set up iptables to forward all web traffic back out port 8080.
I am thinking this is my problem can someone confirm and let me know what I need to do?

TIA
Rick
 
Old 09-08-2005, 09:52 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
If you do not wish to use it in transparent mode, then iptables shouldn't really come into play. Clients just need to be configured to use the proxy.
 
Old 09-08-2005, 10:14 AM   #3
cortj
LQ Newbie
 
Registered: Feb 2003
Posts: 13

Original Poster
Rep: Reputation: 0
I thought so to

But it isnt working and I netstat and see the connection on the proxy server I also lynx from the box so I know squid should be able to do dns queries and I have tried rebuilding the cache with no luck here is my stripped squid .conf file
http_port 8080
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/password
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
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 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users
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
http_reply_access allow all
icp_access allow all
visible_hostname webproxy
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
coredump_dir /var/spool/squid
 
Old 09-08-2005, 10:43 AM   #4
cortj
LQ Newbie
 
Registered: Feb 2003
Posts: 13

Original Poster
Rep: Reputation: 0
looks like

It still looks like it is sendingout a request for the web page but it is not redirecting the page back through port 8080
 
Old 09-08-2005, 11:40 AM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
It should work like this:

client --> proxy --> webserver
client <-- proxy <-- webserver

No redirection needed, they're separate connections.
 
Old 09-08-2005, 12:03 PM   #6
cortj
LQ Newbie
 
Registered: Feb 2003
Posts: 13

Original Poster
Rep: Reputation: 0
access.log

this is my access.log
1126193660.966 26 192.168.1.1 TCP_DENIED/403 1336 CONNECT 64.233.161.99:80 - NONE/- text/html
1126194328.110 4 192.168.1.1 TCP_DENIED/403 1367 GET http://news.google.com/nwshp? - NONE/- text/html
1126194330.272 393 192.168.1.1 TCP_DENIED/403 1367 GET http://news.google.com/nwshp? - NONE/- text/html

What do I have wrong?
 
Old 09-08-2005, 12:13 PM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You know, I don't see you allowing access for anyone in your squid config. Nothing about your local lan.
 
Old 09-19-2005, 01:06 PM   #8
cortj
LQ Newbie
 
Registered: Feb 2003
Posts: 13

Original Poster
Rep: Reputation: 0
left it out

I added it in and it's corresponding http_acces still nothing, but I discovered WARNING: Cannot run '/usr/lib/squid/ncsa_auth' process in my /var/log/squid/cache.log
Without Authentication Squid works with Authentication it fails.
I need simple authentication for 2 users.
 
Old 10-11-2006, 02:44 AM   #9
medokoko2005
LQ Newbie
 
Registered: Apr 2006
Posts: 2

Rep: Reputation: 0
Post give me your solution

i have faced the same problem so i want to know how you have overcome this problem
 
Old 10-11-2006, 04:05 AM   #10
bonowax
Member
 
Registered: Jul 2006
Location: Suburbs of Lisbon, Portugal
Distribution: Slackware, FreeBSD
Posts: 75

Rep: Reputation: 16
Hi;

If you compiled Squid from source, then somewhere in your source tree - src/helpers/basic/NCSA *but I'm not sure - look for it* - is the source code for the authenticators you wish to use with squid... Usually, these are specified during the 'config' step, but I've built authenticators just by CD'ing to the source directory containing them and running 'make'. After that, copy the binary to the location in which squid expects it and you should be good to go.

Cheers
 
  


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
webserver behind firewall and squid ultraav Linux - Networking 6 06-17-2004 05:08 PM
Squid & my firewall Apollo77 Linux - General 3 03-19-2004 10:29 AM
help with client side NFS-firewall setup and server side NIS-firewall setup niverson Linux - Networking 3 02-02-2004 08:52 AM
firewall and squid keshif Linux - Security 1 01-23-2004 09:25 AM
firewall for SQUID freelinuxcpp Linux - Networking 2 12-01-2003 01:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:19 AM.

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