All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stef Coene <stef.coene@docum.org>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] matching classid with iptables and stuff
Date: Fri, 06 Sep 2002 05:55:09 +0000	[thread overview]
Message-ID: <marc-lartc-103129193105600@msgid-missing> (raw)
In-Reply-To: <marc-lartc-103122089029233@msgid-missing>

On Thursday 05 September 2002 12:09, mdew wrote:
> # 40.10 Paul 40.11 Mark
> tc class add dev imq0 parent 40:1   classid 40:10 htb rate 5Kbps ceil
> 7Kbps burst 2k
> tc class add dev imq0 parent 40:1   classid 40:11 htb rate 5Kbps ceil
> 6Kbps burst 3k
> # 40:12 Mike 40:13 Brian
> tc class add dev imq0 parent 40:1   classid 40:12 htb rate 200Kbps ceil
> 220Kbps burst 4k
> tc class add dev imq0 parent 40:1   classid 40:13 htb rate 200Kbps ceil
> 240Kbps burst 4k

> how do i show 40:1x is the ip w.x.y.z (and for the other ip's) ?
What do you mean with "show"?  Do you want to put the traffic from/to the 
different ip's in the different class?  If yes, you need some filters (like 
u32 or fw).

> Working off the prensentation..
> Basically we have a 256Kb connection (yes small fry)
>
> ## We Start at the root of the device, eth0
> # Install HTB as the root qdisc, names it 1:0.
> tc qdisc add dev eth0 root handle 1: htb
> # This attaches a shaping HTB to the HTB root, 256kps with a 2k bucket
> tc gdisc add dev eth0 parent 1: classid 1:1 htb rate 256Kbps burst 20k
>
> #The first class is guaranteed 5Kbps of the 256Kbps, but can grow to 7
> if available
> #The second class however can take up to 240kbits (changed)
> # 1.10 Paul 1.11 Mark
> tc class add dev eth0 parent 1:1 classid 1:10 htb rate 5Kbps ceil 7Kbps
> burst 2k
> tc class add dev eth0 parent 1:1 classid 1:11 htb rate 5Kbps ceil 6Kbps
> burst 3k
> # 1:12 Mike 1:13 Brian
> tc class add dev eth0 parent 1:1 classid 1:12 htb rate 200Kbps ceil
> 220Kbs burst 4k
> tc class add dev eth0 parent 1:1 classid 1:13 htb rate 200Kbps ceil
> 240Kbs burst 4k
>
> ## Filtering to Classify traffic
> # When a packet enters the qdisc it needs to be classified. This is done
> with 'tc filters':
> U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32"
> $U32 match ip dport 25 0xffff flowid 1:10
> $U32 match ip sport 80 0xffff flowid 1:11
>
> ## Shape incoming Traffic (IMQ)
> modprobe imq numdevs=1
> tc qdisc add dec imq0 root handle 40: htb default 22
> tc class add dev imq0 parent 40:    classid 40:1  htb rate 256Kbps burst
> 20k
> # 40.10 Paul 40.11 Mark
> tc class add dev imq0 parent 40:1   classid 40:10 htb rate 5Kbps ceil
> 7Kbps burst 2k
> tc class add dev imq0 parent 40:1   classid 40:11 htb rate 5Kbps ceil
> 6Kbps burst 3k
> # 40:12 Mike 40:13 Brian
> tc class add dev imq0 parent 40:1   classid 40:12 htb rate 200Kbps ceil
> 220Kbps burst 4k
> tc class add dev imq0 parent 40:1   classid 40:13 htb rate 200Kbps ceil
> 240Kbps burst 4k
>
> tc class add dev imq0 parent 40:10  classid 40:11 htb rate 240Kbps burst
> 4k
???  Why are you doing this?  The parent has a ceil of 7Kbps, so this class 
will get never more then 7Kbps.

> iptables -t mangle -A PREROUTING -i eth0 -j IMQ
> # Push all Pauls traffic through IMQ
> iptables -t mangle -A PREROUTING -i eth0 -p tcp -d 10.0.0.9 -j IMQ
> --todev 0
> ip link setup imq0 up
>
> am i close? :)
Don't you have to put also the other traffic (Mark, Mike, Brian) traffic in 
the imq0 device ?

Stef


-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

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

      parent reply	other threads:[~2002-09-06  5:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-05 10:09 [LARTC] matching classid with iptables and stuff mdew
2002-09-05 10:23 ` mdew
2002-09-06  5:55 ` Stef Coene [this message]

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=marc-lartc-103129193105600@msgid-missing \
    --to=stef.coene@docum.org \
    --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.