All of lore.kernel.org
 help / color / mirror / Atom feed
* Squid + iptables + apache
@ 2005-09-26  3:41 Enrique A. Tobis
  0 siblings, 0 replies; 4+ messages in thread
From: Enrique A. Tobis @ 2005-09-26  3:41 UTC (permalink / raw)
  To: netfilter

I managed to solve my problem, but, for future reference, I answer
Edmundo's question. The error I was getting from squid was

"
ERROR
The requested URL could not be retrieved

While trying to retrieve the URL: http://something.dyndns.org/

The following error was encountered:

    * Connection Failed

The system returned:

    (111) Connection refused

The remote host or network may be down. Please try the request again.
"

support@ilgtravel.com suggested enabling the option
X-forwarded-something on squid. I tried that, and it didn't work.

Now, /dev/rob0's solution doesn't work either. Firefox just cannot
connect to the host.

However, as you might have seen from the squid message, I was trying
to access 192.168.0.3, as a host, but using the dyndns name it has. Of
course, that name is associated with the ppp0 interface. Adding an
appropriate rule in ip-up did the trick.

/usr/sbin/iptables -t nat -I PREROUTING 1 -i eth0 -p tcp -d $4 --dport
80 -j DNAT --to 192.168.0.1:80

Even so, I tried /dev/rob0's solution, and I tried to acces the host
as 192.168.0.3, and it still doesn't work.

Thank you all for your suggestions.
Enrique

On Monday 19 September 2005 23:57, Enrique Augusto Tobis wrote:
> To sum it up, almost everything is working as it should. But, if I
> try to access 192.168.0.3 from INSIDE the network, I get an error
> from squid...
>
> I activate the transparent proxy with
> iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT
> --to-port 8080
>
> and forward the port 80 connections with
> iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to
> 192.168.0.1:80

iptables -vt nat -I PREROUTING -i eth0 -d 192.168.0.3 -p tcp \
    --dport 80 -j ACCEPT

*Might* do it. My guess is that this router is seeing the packets to
192.168.0.3 for some reason. My rule (-I to insert at top) will bypass
your REDIRECT rule.

Edmundo's question is valid. Normally a host would not go through your
firewall to reach another host on the same physical segment. So my
guess might be wrong.


^ permalink raw reply	[flat|nested] 4+ messages in thread
* Squid +iptables + apache
@ 2005-09-20  4:57 Enrique Augusto Tobis
  2005-09-20 12:29 ` Edmundo Carmona
  2005-09-20 13:12 ` /dev/rob0
  0 siblings, 2 replies; 4+ messages in thread
From: Enrique Augusto Tobis @ 2005-09-20  4:57 UTC (permalink / raw)
  To: netfilter

Hi!

I've been looking for a solution to this problem, but I haven't been able to 
find one. Any ideas?

I have a small home network. I recently set up an old pc as out gateway. I 
have

192.168.0.3 connecting to the internet, running squid, and acting as the 
firewall/gateway (using nat).
192.168.0.1 running apache.

I want to use squid in 192.168.0.3 as a transparent proxy. So far, that works. 
That is, traffic from the 192.168.0.0 network is processed transparently 
by .0.3 

I also forwarded connections to port 80 on .0.3 to .0.1, which is running the 
web server. I can successfully access that web server from outside the 
network.

To sum it up, almost everything is working as it should. But, if I try to 
access 192.168.0.3 from INSIDE the network, I get an error from squid...

I activate the transparent proxy with
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 
8080   

and forward the port 80 connections with 
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.0.1:80     

in that order.

Any ideas?
Thanks!
Enrique


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-26  3:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-26  3:41 Squid + iptables + apache Enrique A. Tobis
  -- strict thread matches above, loose matches on Subject: below --
2005-09-20  4:57 Squid +iptables " Enrique Augusto Tobis
2005-09-20 12:29 ` Edmundo Carmona
2005-09-20 13:12 ` /dev/rob0

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.