On Wed, 22 Oct 2003 19:52:18 -0700, Bertrand Sirodot wrote:
> Hi,
>
> here is the network configuration of my firewall:
> eth1 = connected to the internet
> eth0 = connected to my internal lan
>
> On the internal lan, I have a web server, so I do port forwarding on
> the firewall to forward all the connections coming to port 80 to the
> port 80 of the web server.
> I am running debian unstable, with kernel 2.4.18 and iptables 1.2.6a.
>
> My problem is the following: I can access my web server from the
> internet without any problem, so the port forwarding on that side
> works well, but if I try, from any server on the internal lan, to do
> links http://<external IP> , then I get a connection refused. I have
> looked at various mailing lists and done quite a few searches on the
> web and google, but I don't seem to find anything.
When you connect from internal machine to server, packet gets routed to
firewall machine and it forwards the packet to server. Server responds
directly to internal machine using its internal ip. The problem is that
reply packets source address is different from request packets destination
address.
Ugly hack to fix it:
Server:
ipconfig eth0:1 EXTERNAL_IP
route del -net EXTERNAL_NET netmask 255.255.255.0 eth0
Client:
route add -host EXTERNAL_IP eth0
I assumed that you have only one nic in server and client. If you do this
all packets client sends to EXTERNAL_IP gets routed to server.
--
Jari Laurila
|