From: David Trott <linux@davidtrott.com>
To: netfilter@lists.netfilter.org
Subject: Question about Nth matching
Date: Thu, 15 May 2003 19:11:18 -0700 [thread overview]
Message-ID: <1053051078.3ec448c633470@www.mailshell.com> (raw)
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).
next reply other threads:[~2003-05-16 2:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-16 2:11 David Trott [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-05-15 17:34 Question about nth matching linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1053051078.3ec448c633470@www.mailshell.com \
--to=linux@davidtrott.com \
--cc=netfilter@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.