LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-01-2003, 04:10 PM   #1
Steave
Member
 
Registered: Jul 2001
Location: Braunschweig, Germany
Distribution: Suse 7.2
Posts: 184

Rep: Reputation: 30
transparent squid problem


hi people!

I'm trying to set up a transparent squid proxy on my linux router and run into the following problem:

The Squid proxy seems to run fine. If I configure my IE to use the proxy to access the internet everything works fine.
But when I forward traffic to port 80 to the proxy-port on the gateway machine and try to access the Internet as if there were no proxy, squid gives me the following error:

While trying to retrieve the URL: /
The following error was encountered:
Invalid URL

Some aspect of the requested URL is incorrect. Possible problems:
Missing or incorrect access protocol (should be `http://'' or similar)
Missing hostname
Illegal double-escape in the URL-Path
Illegal character in hostname; underscores are not allowed

at least the portredirection seems to work

Any hints? Thanx in advance, Steave.

BTW using opera doesn't change anything.
 
Old 05-01-2003, 11:38 PM   #2
MadRabbit
LQ Newbie
 
Registered: Mar 2003
Location: Canada
Distribution: Slackware 8.x, 9.x
Posts: 26

Rep: Reputation: 15
You need a line sorta like this in your firewall setup:

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport www -j REDIRECT --to-port 8080

and you need a line sorta like this in your squid.conf:

http_port 8080

And your firewall needs to let replies back in.
 
Old 05-02-2003, 02:47 AM   #3
Steave
Member
 
Registered: Jul 2001
Location: Braunschweig, Germany
Distribution: Suse 7.2
Posts: 184

Original Poster
Rep: Reputation: 30
The error-message is generated by squid -- so port-redirection is definitely working.

The internet access works via NAT and through the proxy (if not accessed transparently), so I think the firewall isn't the problem either

I guess it's a configuration problem in either squid or my IE/Opera
 
Old 05-02-2003, 07:58 AM   #4
MadRabbit
LQ Newbie
 
Registered: Mar 2003
Location: Canada
Distribution: Slackware 8.x, 9.x
Posts: 26

Rep: Reputation: 15
Hmmm.... I'm using squid in transparent proxy mode too, thru NAT, and none of my IE users needed any additiional configuration: just left all the proxy settings blank on IE. Same with Mozilla/Netscape, no proxy settings needed, ran right "out of the box".

As far as I remember, the stuff I posted above was all I did to get transparent proxying.

I've also got the following lines in squid.conf:

httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

I thought they were mostly for http acceleration but maybe they have an effect on proxying too
 
Old 05-02-2003, 10:30 AM   #5
Steave
Member
 
Registered: Jul 2001
Location: Braunschweig, Germany
Distribution: Suse 7.2
Posts: 184

Original Poster
Rep: Reputation: 30
hooray!

it worked!

you obviously need

httpd_accel_uses_host_header on

(which is also stated in my heavily commented squid.conf)

and

httpd_accel_host_virtual on

(which isn't even mentioned in my squid.conf)

thanx for your help!
 
Old 05-02-2003, 01:45 PM   #6
MadRabbit
LQ Newbie
 
Registered: Mar 2003
Location: Canada
Distribution: Slackware 8.x, 9.x
Posts: 26

Rep: Reputation: 15
No prob

Glad I could help
 
Old 05-04-2003, 10:56 PM   #7
n.antonio
LQ Newbie
 
Registered: Apr 2003
Posts: 18

Rep: Reputation: 0
httpd_accel_host_virtual on? Is there a directive for squid.conf like this???
 
Old 05-05-2003, 12:51 AM   #8
MadRabbit
LQ Newbie
 
Registered: Mar 2003
Location: Canada
Distribution: Slackware 8.x, 9.x
Posts: 26

Rep: Reputation: 15
Quote:
Originally posted by MadRabbit
httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
http_accel_host virtual

that is how I have it. It is documented in the comments that come in the default squid.conf file
 
  


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 Transparent win32sux Linux - Networking 2 08-05-2005 11:57 AM
Squid as a transparent proxy kemplej Linux - Software 2 12-08-2004 05:00 PM
transparent proxy with squid problem philipph Linux - Networking 5 04-19-2004 09:03 AM
SQUID as Httpd-accelerator, 2webservers, transparent routing problem. Pls help! sailor Linux - Networking 6 10-16-2003 10:08 AM
Squid with Transparent Proxy MarleyGPN Linux - Networking 1 08-28-2003 02:51 PM

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

All times are GMT -5. The time now is 12:30 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