All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Andy Furniss <andy.furniss@dsl.pipex.com>
Cc: LARTC@mailman.ds9a.nl, netfilter-devel@lists.netfilter.org,
	junk@maild.mine.nu
Subject: Re: [LARTC] How to balance OUTBOUND traffic by packet if..
Date: Fri, 14 Jan 2005 02:08:02 +0000	[thread overview]
Message-ID: <41E72982.5000205@trash.net> (raw)
In-Reply-To: <41E6694A.2020203@dsl.pipex.com>

Andy Furniss wrote:

> Seems still broken.
>
> I built vanilla(apart from nth) 2.6.10, new iptables 1.2.11 + 
> pom-200400621 with runme extra only said y to nth.
>
> I see -
>
> Chain OUTPUT (policy ACCEPT 817 packets, 103K bytes)
>  pkts bytes target     prot opt in     out     source destination
>    15  1260 MARK       all  --  *      eth0    0.0.0.0/0 
> 0.0.0.0/0           every 2th packet #0 MARK set 0x1
>    15  1260 MARK       all  --  *      eth0    0.0.0.0/0 
> 0.0.0.0/0           every 2th packet #1 MARK set 0x2
>
> Chain POSTROUTING (policy ACCEPT 817 packets, 103K bytes)
>  pkts bytes target     prot opt in     out     source destination
>     0     0            all  --  *      eth0    0.0.0.0/0 
> 0.0.0.0/0           MARK match 0x1
>    15  1260            all  --  *      eth0    0.0.0.0/0 
> 0.0.0.0/0           MARK match 0x2
> [root@amd /home/andy]# cat ./nth-test
> iptables -t mangle -A OUTPUT -o eth0 -m nth --counter 1 --every 2 
> --packet 0 -j MARK --set-mark 1
> iptables -t mangle -A OUTPUT -o eth0 -m nth --counter 1 --every 2 
> --packet 1 -j MARK --set-mark 2
> iptables -t mangle -A POSTROUTING -o eth0 -m mark --mark 1
> iptables -t mangle -A POSTROUTING -o eth0 -m mark --mark 2
>
> Any Ideas anyone?


Try adding "-m mark --mark X -j RETURN" rules after the MARK rules. The MARK
target is non-terminal, so you are overwriting the mark in the second rule.
Alternatively you can use "--start 1" in the one of the nth matches.

Regards
Patrick


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

WARNING: multiple messages have this Message-ID (diff)
From: Patrick McHardy <kaber@trash.net>
To: Andy Furniss <andy.furniss@dsl.pipex.com>
Cc: LARTC@mailman.ds9a.nl, netfilter-devel@lists.netfilter.org,
	junk@maild.mine.nu
Subject: Re: [LARTC] How to balance OUTBOUND traffic by packet if..
Date: Fri, 14 Jan 2005 03:08:02 +0100	[thread overview]
Message-ID: <41E72982.5000205@trash.net> (raw)
In-Reply-To: <41E6694A.2020203@dsl.pipex.com>

Andy Furniss wrote:

> Seems still broken.
>
> I built vanilla(apart from nth) 2.6.10, new iptables 1.2.11 + 
> pom-200400621 with runme extra only said y to nth.
>
> I see -
>
> Chain OUTPUT (policy ACCEPT 817 packets, 103K bytes)
>  pkts bytes target     prot opt in     out     source destination
>    15  1260 MARK       all  --  *      eth0    0.0.0.0/0 
> 0.0.0.0/0           every 2th packet #0 MARK set 0x1
>    15  1260 MARK       all  --  *      eth0    0.0.0.0/0 
> 0.0.0.0/0           every 2th packet #1 MARK set 0x2
>
> Chain POSTROUTING (policy ACCEPT 817 packets, 103K bytes)
>  pkts bytes target     prot opt in     out     source destination
>     0     0            all  --  *      eth0    0.0.0.0/0 
> 0.0.0.0/0           MARK match 0x1
>    15  1260            all  --  *      eth0    0.0.0.0/0 
> 0.0.0.0/0           MARK match 0x2
> [root@amd /home/andy]# cat ./nth-test
> iptables -t mangle -A OUTPUT -o eth0 -m nth --counter 1 --every 2 
> --packet 0 -j MARK --set-mark 1
> iptables -t mangle -A OUTPUT -o eth0 -m nth --counter 1 --every 2 
> --packet 1 -j MARK --set-mark 2
> iptables -t mangle -A POSTROUTING -o eth0 -m mark --mark 1
> iptables -t mangle -A POSTROUTING -o eth0 -m mark --mark 2
>
> Any Ideas anyone?


Try adding "-m mark --mark X -j RETURN" rules after the MARK rules. The MARK
target is non-terminal, so you are overwriting the mark in the second rule.
Alternatively you can use "--start 1" in the one of the nth matches.

Regards
Patrick

  reply	other threads:[~2005-01-14  2:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-07 14:40 [LARTC] How to balance OUTBOUND traffic by packet if junk
2005-01-08 12:02 ` Andy Furniss
2005-01-11  0:28 ` junk
2005-01-11  2:31 ` gypsy
2005-01-11 10:02 ` junk
2005-01-12 11:10 ` Andy Furniss
2005-01-12 11:36 ` Andy Furniss
2005-01-13  3:21 ` Andy Furniss
2005-01-13 12:27   ` Andy Furniss
2005-01-13 12:27     ` Andy Furniss
2005-01-14  2:08     ` Patrick McHardy [this message]
2005-01-14  2:08       ` Patrick McHardy
2005-01-14 15:10       ` Andy Furniss
2005-01-14 15:10         ` Andy Furniss

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=41E72982.5000205@trash.net \
    --to=kaber@trash.net \
    --cc=LARTC@mailman.ds9a.nl \
    --cc=andy.furniss@dsl.pipex.com \
    --cc=junk@maild.mine.nu \
    --cc=netfilter-devel@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.