From: mdew <mdew@mdew.dyndns.org>
To: lartc@vger.kernel.org
Subject: [LARTC] matching classid with iptables and stuff
Date: Thu, 05 Sep 2002 10:09:38 +0000 [thread overview]
Message-ID: <marc-lartc-103122089029233@msgid-missing> (raw)
[-- Attachment #1: Type: text/plain, Size: 2562 bytes --]
# 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) ?
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
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? :)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2002-09-05 10:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-05 10:09 mdew [this message]
2002-09-05 10:23 ` [LARTC] matching classid with iptables and stuff mdew
2002-09-06 5:55 ` Stef Coene
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-103122089029233@msgid-missing \
--to=mdew@mdew.dyndns.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox