Port forwarding question

David shadoweyez at gmail.com
Mon Apr 30 19:37:35 CEST 2007


Hi all - first post, should be a simple question but google and the docs are not
helping

I want to forward port 10000 from internal hosts to the internet and it works with:

iptables -t nat -A PREROUTING -p tcp --dport 10000 -i ppp0 -j DNAT --to 192.168.0.2

for the host with ip 192.168.0.2, but how do I forward it for a range of hosts,
ie 192.168.0.2-192.168.0.254

I try

iptables -t nat -A PREROUTING -p tcp --dport 10000 -i ppp0 -j DNAT --to
192.168.0.2-192.168.0.254

but it does not work for any other hosts

iptables -L -v -t nat
gives the range, but does not actually forward the port in any apps
tcp dpt:10000 to:192.168.0.2-192.168.0.254

How do I forward the range of ports?
TIA,
David

==============================================
Running gentoo 2.16.18.4, iptables 1.3.5



More information about the netfilter mailing list