LinuxQuestions.org
Visit Jeremy's Blog.
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-09-2008, 03:55 PM   #1
merlot2
LQ Newbie
 
Registered: Sep 2008
Posts: 1

Rep: Reputation: 0
IPTables and Squid3 problem


Hi!
I have a problem with squid3 is transparent mode.
In our LAN we have a firewall (with 3 interfaces), a squid (squid3) machine and a couple of clients. So the squid is on another machine as the firewall.
I configured IPTables, that forwards the web requests to the squid box, so added these rows to the existing config of IPTables:

iptables -t nat -A prerouting -p tcp -i "LAN_IFACE" -s "my_client_IP" --dport 80 -j DNAT --to-destination "squid_machine_IP":8080
and
iptables -t nat POSTROUTING -o INTERNET_IFACE -j MASQUERADE

I think, this two rules have to forward my web requests to squid box IP and port.

The squid is running perfect, if I set the web browser proxy settings manualy. But when I set the proxy to transparent mode (remove browser proxy settings and set in squid.conf: http_port "SQUID_IP":8080 transparent), on my client in web browser any of the web sites cannot be displayed, the browser search for IP, and doesn't find any website.

If I change the POSTROUTING by remove the interface, so:
iptables -t nat POSTROUTING -j MASQUERADE
then the browser says for all web site:
Invalid URL etc, with title SQUID3, so it seems, the packets forwarded to squid, but after that I can't understand, what happens.

If I set my client's gateway to squid machine IP manually (the squid machine gateway is the firewall), it works fine in transparent mode too. But the clients works with DHCP, and the default gateway is the firewall on every client.

I think, that something wrong yet with the packets direction, or addresses. I read, that someone uses SNAT instead MASQUERADE, but it did not help.


Could you please help me to solve the problem? Thank you in advance!!!
 
Old 09-09-2008, 09:16 PM   #2
zmanea
Member
 
Registered: Sep 2003
Location: Colorado
Posts: 85

Rep: Reputation: 15
http://www.faqs.org/docs/Linux-mini/...tProxy.html#s6
 
  


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
squid2 or squid3 ? cccc Linux - Server 2 10-06-2008 01:23 PM
SQUID3.0 dont know why it exits hemi_426 Linux - Server 2 06-16-2008 11:38 PM
--enable-icap-client at squid3 cccc Debian 1 05-06-2008 01:07 PM
Squid3 on Ubuntu TCP_MISS sscultima Ubuntu 2 01-08-2008 04:28 AM
Squid3 on Ubuntu Server 7.04 sscultima Ubuntu 9 08-13-2007 10:15 AM

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

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