Skip to contentSkip to conversation

dnat to multiple destination

DISCUSSION �� ���� ��r���g �� 5 participants 7 messages Oct 26, 2005

lore
Share & tools
lore
#0 lore raw

hi there,

recently i read iptables man page,
in the DNAT part :
You can add several --to-destination options. If you specify more than
one destination address, either via an address range or multiple --to-des­
tination options, a simple round-robin (one after another in cycle) load
balancing takes place between these adresses.

in my mind, it sounds like:
iptables -A PREROUTING -s xxx.xxx.xxx.xxx -p tcp --dport 80 -j DNAT --to-destination aaa.aaa.aaa.aaa --to-destination bbb.bbb.bbb.bbb

but it says invalid arguments.
which part was wrong ?

cheers,
Agung

__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

#1 lore raw

°° þãþã ßêrûâñg °° napisał(a):

Quoted 6 lines

iptables -A PREROUTING -s xxx.xxx.xxx.xxx -p tcp --dport 80 -j DNAT --to-destination aaa.aaa.aaa.aaa --to-destination bbb.bbb.bbb.bbb

but it says invalid arguments.
which part was wrong ?

try [...]-p tcp -m tcp --dport 80[...]

#2 lore raw
In reply to �� ���� ��r���g ��
Quoted 12 lines · °° þãþã ßêrûâñg °°

hi there,

recently i read iptables man page,
in the DNAT part :
You can add several --to-destination options. If you specify more than
one destination address, either via an address range or multiple --to-des­
tination options, a simple round-robin (one after another in cycle) load
balancing takes place between these adresses.

Quoted 4 lines

in my mind, it sounds like:
iptables -A PREROUTING -s xxx.xxx.xxx.xxx -p tcp --dport 80 -j DNAT --to-destination aaa.aaa.aaa.aaa --to-destination bbb.bbb.bbb.bbb

Try adding -t nat

#3 lore raw

dnat to multiple destination *correction*

In reply to �� ���� ��r���g ��

hi there,

recently i read iptables man page,
in the DNAT part :
You can add several --to-destination options. If you specify more than
one destination address, either via an address range or multiple --to-des­tination options, a simple round-robin (one after another in cycle) load balancing takes place between these adresses.

in my mind, it sounds like:
iptables -t nat -A PREROUTING -s xxx.xxx.xxx.xxx -p tcp
--dport 80 -j DNAT --to-destination aaa.aaa.aaa.aaa --to-destination bbb.bbb.bbb.bbb

but it says invalid arguments.
which part was wrong ?

cheers,
Agung

__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs

#4 lore raw
In reply to �� ���� ��r���g ��

Hi,

Quoted 10 lines · °° þãþã ßêrûâñg °°

recently i read iptables man page,
in the DNAT part :
You can add several --to-destination options. If you specify more than
one destination address, either via an address range or multiple --to-des­
tination options, a simple round-robin (one after another in cycle) load
balancing takes place between these adresses.

Quoted 7 lines

in my mind, it sounds like:
iptables -A PREROUTING -s xxx.xxx.xxx.xxx -p tcp --dport 80 -j DNAT --to-destination aaa.aaa.aaa.aaa --to-destination bbb.bbb.bbb.bbb

but it says invalid arguments.
which part was wrong ?

Unfortunately that possibility was removed when restructuring the
Linux NAT for the 2.6.11 Linux release. Should work with older kernels, or you can work it around by using two DNAT rules and the 'random' match from patch-o-matic-ng. Ugly, but it should work that way.

http://www.netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO-3.html#ss3.14

Signature · 2 lines
 Regards,
  Krisztian Kovacs
#5 lore raw

Unfortunately that possibility was removed when

Quoted 9 lines

restructuring the
Linux NAT for the 2.6.11 Linux release. Should work with older kernels,
or you can work it around by using two DNAT rules and the 'random'
match from patch-o-matic-ng. Ugly, but it should work that way.

http://www.netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO-3.html#ss3.14

Quoted 5 lines
Signature · 3 lines
-- 
 Regards,
  Krisztian Kovacs

ok thanks :-)

@Jörg
i've correct my post, i've use -t nat just miss type when i write my post. thx anyway :-)

__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs

#6 lore raw
In reply to KOVACS Krisztian
Quoted 2 lines · KOVACS Krisztian

Unfortunately that possibility was removed when restructuring the
Linux NAT for the 2.6.11 Linux release. Should work with older kernels,

Was repordedly broken in older kernels...

Regards
Henrik