* --to-destination of DNAT issue -- or my misinterpretation? [not found] ` <c6c65ec80609131838x35b95470m42a61c6d6f27ec9f@mail.gmail.com> @ 2006-09-14 12:46 ` João Fernandes Simplício 2006-09-14 13:26 ` Jan Engelhardt 0 siblings, 1 reply; 6+ messages in thread From: João Fernandes Simplício @ 2006-09-14 12:46 UTC (permalink / raw) To: netfilter Hello, It seems I can't specify several --to-destination (like the man page tells), and iptables doesn't spit any errors. iptables -t nat -A PREROUTING -p tcp --dport 12345 -d dest-host -s source-host -j DNAT --to-destination dest-host:12346 --to-destination dest-host:12347 --to-destination dest-host:12348 Am I doing something wrong? Could you give me an example of how to do this properly? I'm assuming that the normal behavior is: When I'm connecting from source-host to dest-host:12345, the dest-host does load balancing and randomly chooses one of the three --to-destination parameters. Is this right? Thanks in advanced. -- jfs ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: --to-destination of DNAT issue -- or my misinterpretation? 2006-09-14 12:46 ` --to-destination of DNAT issue -- or my misinterpretation? João Fernandes Simplício @ 2006-09-14 13:26 ` Jan Engelhardt 2006-09-14 13:59 ` Pascal Hambourg 0 siblings, 1 reply; 6+ messages in thread From: Jan Engelhardt @ 2006-09-14 13:26 UTC (permalink / raw) To: João Fernandes Simplício; +Cc: netfilter > > Hello, > > It seems I can't specify several --to-destination (like the man page > tells), and iptables doesn't spit any errors. > > iptables -t nat -A PREROUTING -p tcp --dport 12345 -d dest-host -s > source-host -j DNAT --to-destination dest-host:12346 --to-destination > dest-host:12347 --to-destination dest-host:12348 > > Am I doing something wrong? Only one --to-destination is supported. Jan Engelhardt -- ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: --to-destination of DNAT issue -- or my misinterpretation? 2006-09-14 13:26 ` Jan Engelhardt @ 2006-09-14 13:59 ` Pascal Hambourg 2006-09-14 14:01 ` Jan Engelhardt 0 siblings, 1 reply; 6+ messages in thread From: Pascal Hambourg @ 2006-09-14 13:59 UTC (permalink / raw) To: netfilter Jan Engelhardt a écrit : >>Hello, >> >>It seems I can't specify several --to-destination (like the man page >>tells), and iptables doesn't spit any errors. >> >>Am I doing something wrong? > > Only one --to-destination is supported. This restriction was first introduced in kernel 2.6.11. Previous 2.6 kernels, as well as 2.4 kernels, should support multiple ranges. ChangeLog-2.6.11 : " [PATCH] Remove NAT to multiple ranges The NAT code has the concept of multiple ranges: you can say "map this connection onto IP 192.168.1.2 - 192.168.1.4, 192.168.1.7 ports 1024-65535, and 192.168.1.10". I implemented this because we could. But it's not actually *used* by many (any?) people, and you can approximate this by a random match (from patch-o-matic) if you really want to. It adds complexity to the code." changes-iptables-1.3.4.txt : " Print error message when multiple "--to" DNAT/SNAT args are used with kernel >= 2.6.10" ^^ There seems to be a little mistake here, should be 2.6.11 according to Linux changelog. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: --to-destination of DNAT issue -- or my misinterpretation? 2006-09-14 13:59 ` Pascal Hambourg @ 2006-09-14 14:01 ` Jan Engelhardt 2006-09-14 14:22 ` Pascal Hambourg 0 siblings, 1 reply; 6+ messages in thread From: Jan Engelhardt @ 2006-09-14 14:01 UTC (permalink / raw) To: Pascal Hambourg; +Cc: netfilter >> > It seems I can't specify several --to-destination (like the man page >> > tells), and iptables doesn't spit any errors. >> > >> > Am I doing something wrong? >> >> Only one --to-destination is supported. > > This restriction was first introduced in kernel 2.6.11. Previous 2.6 kernels, > as well as 2.4 kernels, should support multiple ranges. > > ChangeLog-2.6.11 : > " [PATCH] Remove NAT to multiple ranges > The NAT code has the concept of multiple ranges: you can say "map this > connection onto IP 192.168.1.2 - 192.168.1.4, 192.168.1.7 ports > 1024-65535, and 192.168.1.10". I implemented this because we could. > > But it's not actually *used* by many (any?) people, and you can > approximate this by a random match (from patch-o-matic) if you really > want to. It adds complexity to the code." > > changes-iptables-1.3.4.txt : > " Print error message when multiple "--to" DNAT/SNAT args are used > with kernel >= 2.6.10" > ^^ > There seems to be a little mistake here, should be 2.6.11 according to Linux > changelog. That iptables(1) manpage got it right: Later Kernels (>= 2.6.11-rc1) don't have the ability to NAT to multiple ranges anymore. > > > Jan Engelhardt -- ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: --to-destination of DNAT issue -- or my misinterpretation? 2006-09-14 14:01 ` Jan Engelhardt @ 2006-09-14 14:22 ` Pascal Hambourg 2006-09-14 14:36 ` Jan Engelhardt 0 siblings, 1 reply; 6+ messages in thread From: Pascal Hambourg @ 2006-09-14 14:22 UTC (permalink / raw) To: netfilter Jan Engelhardt a écrit : > > That iptables(1) manpage got it right: > > Later Kernels (>= 2.6.11-rc1) don't have the ability to NAT to > multiple ranges anymore. Well, the manpage included in my iptables 1.2.11 does't contain this. I wonder what happens when you try to create a NAT rule with multiple --to with iptables < 1.3.4 and Linux >= 2.6.11. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: --to-destination of DNAT issue -- or my misinterpretation? 2006-09-14 14:22 ` Pascal Hambourg @ 2006-09-14 14:36 ` Jan Engelhardt 0 siblings, 0 replies; 6+ messages in thread From: Jan Engelhardt @ 2006-09-14 14:36 UTC (permalink / raw) To: Pascal Hambourg; +Cc: netfilter >> >> That iptables(1) manpage got it right: >> >> Later Kernels (>= 2.6.11-rc1) don't have the ability to NAT >> to >> multiple ranges anymore. > > Well, the manpage included in my iptables 1.2.11 does't contain this. That's a ... *slightly* old iptables. > I wonder what happens when you try to create a NAT rule with multiple > --to with > iptables < 1.3.4 and Linux >= 2.6.11. Will probably return "unknown error 4294967295" (-1). Jan Engelhardt -- ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-14 14:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <c6c65ec80609131835l7d586b6r29e8226a93db7bab@mail.gmail.com>
[not found] ` <c6c65ec80609131838x35b95470m42a61c6d6f27ec9f@mail.gmail.com>
2006-09-14 12:46 ` --to-destination of DNAT issue -- or my misinterpretation? João Fernandes Simplício
2006-09-14 13:26 ` Jan Engelhardt
2006-09-14 13:59 ` Pascal Hambourg
2006-09-14 14:01 ` Jan Engelhardt
2006-09-14 14:22 ` Pascal Hambourg
2006-09-14 14:36 ` Jan Engelhardt
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.