I have a simple ADSL router which has NAT/MASQ function and forwards
all incoming packets to my linux server. However I want some ports to
go to some of my other computers instead.
It has some simple built in rules for sending the NAT packets to other
computers, but these are so limited that I want to use iptables to do
it.
So, my linux server is not really NAT/MASQ since that is already
handled by the ADSL router.
Just for some ports I added a rule like:
iptables -t nat -A PREROUTING -i $EXTIF -p tcp --dport 5552:5553 \
-j DNAT --to-destination 192.168.0.5
The situation is:
internet --- ADSL router (NAT) --- internal net
My internal computers all have 1 ethernet interface, and have their
default gateway pointing to the ADSL router of course.
Now with traceroute I observed, when I tried to make a connection to
my external address (on the outside of the router) and port 5553, that
first it is sent to my linux server, which resends it to the second
computer.
My internal computer sends back an ACK, via the router directly (since
this is the default gateway).
However, the connection is not set up properly and nothing
happens. After a while the outside client times out.
Maybe the NAT/MASQ of the (zyxel) ADSL router is confused that it
forwards the incoming packet to one node, but receives the reply from
another one?
Is it impossible to do such a thing? Must one use a full "double NAT"
i.e. must the linux server be the default gateway for all other
internal hosts even if I only want to redirect a few of the incoming
ports. That seems rather wasteful since in that case all traffic from
other internal nodes to/from the internet is sent twice over the LAN,
and all of it is routed through the linux server for nothing.
--
Peter Mutsaers, Dübendorf, Switzerland.
|