All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Furniss <andy.furniss@dsl.pipex.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] nesting htbs
Date: Mon, 13 Jun 2005 14:36:52 +0000	[thread overview]
Message-ID: <42AD9A04.5040700@dsl.pipex.com> (raw)
In-Reply-To: <39458b08050609033727183846@mail.gmail.com>

Andy Furniss wrote:

> 
> 
> If clientip is local because you are NATing than it won't work because 
> traffic will have the real ip here.
> 
> To work around you could use marks. As you already use them for some 
> things you may want to use --or-mark and u32 to match them eg.
> 
> iptables -A POSTROUTING -t mangle -p icmp -j MARK --set-mark 0x0100
> 
> and so on for traffic types using high byte then use low byte and 
> --or-mark for addresses
> 
> iptables -A POSTROUTING -t mangle -s 192.168.0.1 -j MARK --or-mark 0x0001
> 
> Then filter top level with a mask like
> 
> tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match mark 
> 0x0100 0xff00 flowid 1:20
> 
> and leaf levels
> 
> tc filter add dev eth0 parent 1:20 protocol ip prio 1 u32 match mark 
> 0x0001 0x00ff flowid 1:200
> 
> That assumes you really need iptables for marking traffic type - if you 
> could use tc filters for that, then just use iptables for the addresses.

Something I've only just noticed from a comment in the code - htb can 
use mark without the need for lots of filters.

You only need one empty filter on the root (maybe you can still nest) like -

tc filter add dev eth0 parent 1:0 protocol ip prio 1 fw

and then if you arrange for your classes to be the same minor numbers as 
the marks it will behave like using classify.

You need to set the major number of your htb (1 in example above) in the 
top 16 bits of the mark.

There is also a netfilter pom-ng patch IPMARK that will set marks based 
on ipaddress.

Andy.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

  parent reply	other threads:[~2005-06-13 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-09 10:37 [LARTC] nesting htbs Edward Smith
2005-06-09 23:02 ` Andy Furniss
2005-06-10 11:03 ` Dariusz Dwornikowski
2005-06-13 14:25 ` Andy Furniss
2005-06-13 14:36 ` Andy Furniss [this message]
2005-06-15 11:55 ` Ed W

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=42AD9A04.5040700@dsl.pipex.com \
    --to=andy.furniss@dsl.pipex.com \
    --cc=lartc@vger.kernel.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.