All of lore.kernel.org
 help / color / mirror / Atom feed
* Default server DNAT port remapping problem
@ 2010-02-09 19:33 He Jiafu-MPNB73
  2010-02-09 21:04 ` Mart Frauenlob
  0 siblings, 1 reply; 5+ messages in thread
From: He Jiafu-MPNB73 @ 2010-02-09 19:33 UTC (permalink / raw)
  To: netfilter

Hi, guys,

I've got a problem creating default servers using consecutive DNAT port
range mapping.

Suppose I have a router with a wan (say, 1.2.3.4) and LAN (192.168.1.1)
and another internal server (192.168.1.100). I want to setup a couple of
default servers to forward the wan access to ports 80-90 towards the
internal server ports 8080-8090. I want the port mapping to be 1:1,
i.e., 80 -> 8080, 81 -> 8081, ..., 90 -> 8090.

I tried the following rules:
    # iptables -A PREROUTING -t nat -p udp -d 1.2.3.4 --dport 80:90 -j
DNAT --to 192.168.1.100:8080-8090
    # iptables -A FORWARD -p udp -d 192.168.1.100 --dport 8080:8090 -j
ACCEPT

However, the results are pretty inconsistent. In some cases, I got
shifted mapping like
    83 -> 8080, 84 -> 8081, ...
And even out-of-range mapping like
    80 -> 8091, 81 -> 8092, ...

Has anyone ever seen this before? Is this working as designed or a bug
in the NAT code?

Any suggestion?

Thanks in advance!

J.


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

end of thread, other threads:[~2010-02-10 22:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-09 19:33 Default server DNAT port remapping problem He Jiafu-MPNB73
2010-02-09 21:04 ` Mart Frauenlob
2010-02-09 22:28   ` He Jiafu-MPNB73
2010-02-10 18:05     ` Mart Frauenlob
2010-02-10 22:37       ` He Jiafu-MPNB73

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.