From: Edwin Whitelaw <Edwin.Whitelaw@nrvunwired.net>
To: lartc@vger.kernel.org
Subject: [LARTC] Htb queueing problem
Date: Tue, 11 Apr 2006 14:24:16 +0000 [thread overview]
Message-ID: <443BBC10.20105@nrvunwired.net> (raw)
In-Reply-To: <44043A85.6080302@gmail.com>
A note to confirm that "-m physdev --physdev-is-bridged" in the iptables
command does enable iptables to work in a bridged environment. I was
fighting the same problem and this indeed solved it.
Below is my test script running on a two NIC Debian 3.1 266MHz bridge.
Before adding the physdev flag, only the "tc filter" commands worked but
now the iptables commands also correctly classify the packets both with
the MARK and CLASSIFY approaches. Note that the tc classes were setup
to give clear indication of which class was affecting the flow.
Edwin
---------test tc script----------
#!/bin/bash
RATE€00
#if [ x$1 = 'xstop' ]; then
if [ tc ]; then
echo "Deleting qdisc for eth1"
tc qdisc del dev eth1 root
fi
tc qdisc add dev eth1 root handle 1:0 htb default 90
tc class add dev eth1 parent 1:0 classid 1:1 htb rate ${RATE}kbit ceil
${RATE}kbit
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 3000kbit ceil
3000kbit
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 1500kbit ceil
1500kbit
tc class add dev eth1 parent 1:1 classid 1:30 htb rate 1000kbit ceil
1000kbit
tc class add dev eth1 parent 1:1 classid 1:50 htb rate 500kbit ceil 500kbit
tc class add dev eth1 parent 1:1 classid 1:90 htb rate 256kbit ceil 256kbit
tc qdisc add dev eth1 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth1 parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev eth1 parent 1:30 handle 30: sfq perturb 10
tc qdisc add dev eth1 parent 1:50 handle 50: sfq perturb 10
tc qdisc add dev eth1 parent 1:90 handle 90: sfq perturb 10
#tc filter add dev eth1 parent 1:0 protocol ip u32 match ip sport 80
0xffff classid 1:10
#tc filter add dev eth1 parent 1:0 protocol ip u32 match ip sport 22
0xffff classid 1:20
#tc filter add dev eth1 parent 1:0 protocol ip u32 match ip sport 25
0xffff classid 1:50
#tc filter add dev eth1 parent 1:0 protocol ip u32 match ip sport 110
0xffff classid 1:50
iptables -F -t mangle
#out
#iptables -t mangle -A POSTROUTING -m physdev --physdev-is-bridged -p
tcp --sport 80 -j MARK --set-mark 2
#iptables -t mangle -A FORWARD -o eth1 -p tcp --sport 22 -j MARK
--set-mark 1
#iptables -t mangle -A FORWARD -o eth1 -p tcp --sport 25 -j MARK
--set-mark 1
#iptables -t mangle -A FORWARD -o eth1 -p tcp --sport 110 -j MARK
--set-mark 1
#
iptables -t mangle -A POSTROUTING -m physdev --physdev-is-bridged -p tcp
--sport 80 -j CLASSIFY --set-class 1:50
iptables -t mangle -A POSTROUTING -m physdev --physdev-is-bridged -p tcp
--sport 139 -j CLASSIFY --set-class 1:10
iptables -t mangle -A POSTROUTING -m physdev --physdev-is-bridged -p tcp
--sport 22 -j CLASSIFY --set-class 1:10
iptables -t mangle -A POSTROUTING -m physdev --physdev-is-bridged -p tcp
--sport 25 -j CLASSIFY --set-class 1:10
iptables -t mangle -A POSTROUTING -m physdev --physdev-is-bridged -p tcp
--sport 110 -j CLASSIFY --set-class 1:10
#tc filter add dev eth1 parent 1:0 protocol ip handle 1 fw classid 1:10
#tc filter add dev eth1 parent 1:0 protocol ip handle 2 fw classid 1:20
#tc filter add dev eth1 parent 1:0 protocol ip handle 3 fw classid 1:30
#tc filter add dev eth1 parent 1:0 protocol ip handle 5 fw classid 1:50
#tc filter add dev eth1 parent 1:0 protocol ip handle 9 fw classid 1:90
--
<=+=+=+=+=+=+=+=+=+=+=+=+=+=+=>
Edwin Whitelaw, P.E.
New River Valley Unwired, LLC
2200 Lonesome Dove Dr
Christiansburg, VA 24073
540-239-0318
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
prev parent reply other threads:[~2006-04-11 14:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-28 11:56 [LARTC] Htb queueing problem Diego Andrés Asenjo Gonzalez
2006-03-01 14:48 ` Andy Furniss
2006-03-01 17:39 ` Diego Andrés Asenjo Gonzalez
2006-03-01 19:07 ` Andreas Hasenack
2006-03-01 19:56 ` Andy Furniss
2006-03-01 20:16 ` Andy Furniss
2006-03-02 3:56 ` Diego Andrés Asenjo Gonzalez
2006-03-02 15:59 ` Andy Furniss
2006-03-02 16:20 ` m.innocenti
2006-03-02 16:56 ` Luciano Ruete
2006-03-02 18:27 ` Diego Andrés Asenjo Gonzalez
2006-04-11 14:24 ` Edwin Whitelaw [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=443BBC10.20105@nrvunwired.net \
--to=edwin.whitelaw@nrvunwired.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.