Posted in Howto Linux Proxy

Squid 2.6 : transparent proxy

October 27, 2007 - 8 comments

I was explaining in this article how to enable the transparent proxy feature under Squid 2.5.

The following options required for transparent proxy are no longer available under Squid 2.6 :

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

The new option under Squid 2.6 is the much simpler :

http_port 8080 transparent

You just need to append “transparent” to the http_port option line.

If you upgrade to Squid 2.6 and don’t update your config file you should get the following in the logs :

messages:Oct 27 13:02:08 x squid: parseConfigFile: line 51 unrecognized: 'httpd_accel_host virtual'
messages:Oct 27 13:02:08 x squid: parseConfigFile: line 52 unrecognized: 'httpd_accel_port 80'
messages:Oct 27 13:02:08 x squid: parseConfigFile: line 53 unrecognized: 'httpd_accel_with_proxy on'
messages:Oct 27 13:02:08 x squid: parseConfigFile: line 54 unrecognized: 'httpd_accel_uses_host_header on'

Comments

Dave Wilson

October 31, 2007 - 21:18

What about iptables… I tried to set up the port redirection with this:

iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 3128

but to no avail… Any ideas?

Thanks,

Dave

Sébastien Wains

October 31, 2007 - 21:27

Hi Dave,

What do the logs say ? Do you see the attempts in squid logs.
Do you get squid error messages in your browser ?

Thanks
Seb

glenn

November 17, 2007 - 6:15

For squid versions 2.6 and above, you must add:

http_port 3128 transparent

instead of
#http_port 3128

to make this work.

noiz

September 15, 2008 - 2:43

hi there,

is there anywhere i could use the proxy squid for pop3 and smtp port.

thanks,
regards,
nazrin

Seb

September 15, 2008 - 19:47

squid is designed for proxying web traffic. I guess you need to add a rule in your firewall to allow pop3 and stmp traffic.

jolland h. castro

October 17, 2008 - 10:05

hi.. how about iptables? how to install it in windows xp.. please help.. tnx a lot…

Sébastien Wains

October 17, 2008 - 21:24

iptables configuration is described in the linked article.
Windows XP ? uh :-)

Leave Comment

Please consider visiting the partners below if you enjoyed this article :

If this post saved you time and money, please consider checking my Amazon wishlist.

Before submitting, some rules :
- Is your comment related to the article ?
- You're having a problem ? Have you checked Google, other howtos, docs, manpages ?
- You're still having the problem ? Have you raised log verbosity, checked traces, ran tcpdump ?
- Have you checked your configuratoin for typo ?
Unless your comment is providing additional info or respect the rules above, DON'T comment.
If you don't understand what you are doing, I urge you to read the documentation, I'm not your free Level 1 helpdesk guy.