I have a debian linux firewall/gateway connecting my wan and lan working with iptables. I have
eth1 as the wan with dynamic address
188.8.131.52 attached to
somehost.com via DYNDNS and
eht0 as the lan with address
192.168.128.2. Everything works as expected. Traffic coming in gets rejected for all ports except the ones specified with ACCEPT and the port forwarding works as expected redirecting traffic to the inside machines.
The problem is that when I try to connect to
somehost.com from the inside network I don't get redirected to the internal machines as I expect. My firewall rules for port redirection are attached to the wan interface (
eth1). I'm assuming that when I try to connect to
somehost.com I'm coming from the lan connection and that is why the redirection does not work. I have experimented with REDIRECT, DNAT, INPUT and other tags without success. Any hints on how to achieve this?