From: "Adam Towarnyckyj" <adamt@commspeed.net>
To: lartc@vger.kernel.org
Subject: RE: [LARTC] TC Hashing Filters
Date: Tue, 06 Jul 2004 21:15:04 +0000 [thread overview]
Message-ID: <030001c4639e$4ec173a0$903113d8@uranus> (raw)
In-Reply-To: <005c01c2c1b1$e006a820$0200a8c0@monster>
Gideon was an incredible help with all of this. He solved my
little problem I was having. It was such a simple solution and I
completely missed it. You see, when I changed the src to dst (which is
what I'm trying to accomplish because I'm shaping the download rates of
our customers, not upload rates) I forgot that in the IP Header, bit 12
is the source address. Since I was shaping incoming traffic, I want the
destination IP. Gideon was so kind to point this out to me. I knew it
was something very small and obvious...
So, here are the completed commands that work great for anyone
who is attempting to do this themselves. I will also post to this list
with this same subject the link to the How To as soon as I get it
created.
# Delete current qdisc wiping the slate clean
tc qdisc del dev eth1 root
# Create root qdisc
tc qdisc add dev eth1 root handle 1: cbq bandwidth 200Mbit avpkt 1000
# Create "transit class"
tc class add dev eth1 parent 1: classid 1:2 cbq bandwidth 200Mbit rate
200MBit allot 1514 weight 2Mbit prio 8 maxburst 20 avpkt 1000
# Create hash tables (256)
tc filter add dev eth1 parent 1: handle 2: protocol ip u32 divisor 256
# Create hash filter to separate traffic going TO 216.19.49.0/24 using
the last octet
tc filter add dev eth1 protocol ip parent 1: u32 match ip dst
216.19.49.0/24 hashkey mask 0x000000ff at 16 link 2:
# Create the 128Kbit class for limiting
tc class add dev eth1 parent 1: classid 1:3 cbq bandwidth 200Mbit rate
128Kbit allot 1514 prio 5 maxburst 20 avpkt 1000 bounded
# Filter per IP into the hash tables
tc filter add dev eth1 protocol ip parent 1: u32 ht 2:8c: match ip dst
216.19.49.140 flowid 1:3
(Note: The last filter will need to be done for each IP you want to
limit. Also note that you can create multiple classes for different
rates you would like to limit. You'll just need to point the last
filter's flowid to that class)
Thanks, once again, to everyone for their help and the pointing out of
my obvious mistakes. If anyone has any questions about how to do this or
anything, please feel free to ask. I'll answer to the best of my
abilities.
Adam Towarnyckyj
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
next prev parent reply other threads:[~2004-07-06 21:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-22 1:02 [LARTC] TC Hashing Filters mjoachimiak
2003-01-23 0:08 ` mjoachimiak
2004-07-02 22:54 ` Adam Towarnyckyj
2004-07-03 0:12 ` zoop
2004-07-06 17:02 ` Adam Towarnyckyj
2004-07-06 18:08 ` Adam Towarnyckyj
2004-07-06 19:14 ` zoop
2004-07-06 19:16 ` zoop
2004-07-06 19:36 ` Walt Wyndroski
2004-07-06 20:16 ` Adam Towarnyckyj
2004-07-06 21:15 ` Adam Towarnyckyj [this message]
2004-07-06 21:25 ` Ed Wildgoose
2004-07-12 20:48 ` Adam Towarnyckyj
2004-07-13 1:23 ` gypsy
2004-07-13 17:45 ` Adam Towarnyckyj
2004-07-14 5:57 ` Catalin BOIE
2004-07-14 13:48 ` gypsy
2004-07-14 18:06 ` Adam Towarnyckyj
2004-07-14 18:25 ` Jason Boxman
2004-07-15 2:13 ` gypsy
2004-07-15 12:36 ` Glen Mabey
2004-07-15 17:40 ` Adam Towarnyckyj
2004-07-16 3:36 ` gypsy
2004-07-22 22:07 ` Adam Towarnyckyj
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='030001c4639e$4ec173a0$903113d8@uranus' \
--to=adamt@commspeed.net \
--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.