All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about nth matching
@ 2003-05-15 17:34 linux
  0 siblings, 0 replies; 2+ messages in thread
From: linux @ 2003-05-15 17:34 UTC (permalink / raw)
  To: netfilter

Hi,

I am using the nth patch to perform load balancing for outgoing traffic, specifically these are packets that are generated on the firewall itself (not forwarded traffic).

In order to do this I have used ip route 2 to set up two different routing tables, then I use netfilter to set the MARK so that alternate packets are sent to alternate links.

In order to do this I use the following rules:

iptables -t mangle -A OUTPUT -d 10.1.1.1 -j MARK --set-mark 1
iptables -t mangle -A OUTPUT -d 10.1.1.1 -m nth --every 2 -j MARK --set mark 2

Using the above rules everything appears to be fine, however this style can get messy if you have more than two links so I tried to use the following style:


iptables -t mangle -A OUTPUT -d 10.1.1.1 -m nth --every 2 --packet 0 -j MARK --set-mark 1
iptables -t mangle -A OUTPUT -d 10.1.1.1 -m nth --every 2 --packet 1 -j MARK --set-mark 2

This does not work (it appears that neither mark is set - although I am not certain of this).

Can anyone point me in the right direction in order to get the second case working?

TIA,
David

Notes:
Kernel 2.4.20
Iptables 1.2.7a

Both the kernel and iptables have had a few patches applied although I don’t think this is the cause of the problem.

I have read that sending alternate packets over different links is not always a good idea because it can lead to packets arriving at the destination host in the wrong order. I have been told that this is not a problem for Linux, but some other OS don’t like it, so I have restricted the balancing rules to a host that I know runs Linux.
This is the reason for the –d 10.1.1.1 (on my firewall 10.1.1.1 is replaced with the real IP).


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

* Question about Nth matching
@ 2003-05-16  2:11 David Trott
  0 siblings, 0 replies; 2+ messages in thread
From: David Trott @ 2003-05-16  2:11 UTC (permalink / raw)
  To: netfilter

Hi,

I am using the nth patch to perform load balancing for outgoing traffic, specifically these are packets that are generated on the firewall itself (not forwarded traffic).

In order to do this I have used ip route 2 to set up two different routing tables, then I use netfilter to set the MARK so that alternate packets are sent to alternate links.

In order to do this I use the following rules:

iptables -t mangle -A OUTPUT -d 10.1.1.1 -j MARK --set-mark 1
iptables -t mangle -A OUTPUT -d 10.1.1.1 -m nth --every 2 -j MARK --set mark 2

Using the above rules everything appears to be fine, however this style can get messy if you have more than two links so I tried to use the following style:

iptables -t mangle -A OUTPUT -d 10.1.1.1 -m nth --every 2 --packet 0 -j MARK --set-mark 1
iptables -t mangle -A OUTPUT -d 10.1.1.1 -m nth --every 2 --packet 1 -j MARK --set-mark 2

This does not work (it appears that neither mark is set - although I am not certain of this).

Can anyone point me in the right direction in order to get the second case working?

TIA,
David

Notes:
Kernel 2.4.20
Iptables 1.2.7a

Both the kernel and iptables have had a few patches applied although I don’t think this is the cause of the problem.

I have read that sending alternate packets over different links is not always a good idea because it can lead to packets arriving at the destination host in the wrong order. I have been told that this is not a problem for Linux, but some other OS don’t like it, so I have restricted the balancing rules to a host that I know runs Linux.
This is the reason for the –d 10.1.1.1
(In the real rules 10.1.1.1 is replaced with a real IP address).


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

end of thread, other threads:[~2003-05-16  2:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-16  2:11 Question about Nth matching David Trott
  -- strict thread matches above, loose matches on Subject: below --
2003-05-15 17:34 Question about nth matching linux

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.