From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francisco Pereira Date: Tue, 28 Dec 2004 22:28:31 +0000 Subject: Re: [LARTC] htb and iptables marked packets question Message-Id: <41D1DE0F.6050908@lojan.com> List-Id: References: <6.1.2.0.2.20041227132651.03c312b8@wheresmymailserver.com> In-Reply-To: <6.1.2.0.2.20041227132651.03c312b8@wheresmymailserver.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Hi. Felipe Ceglia wrote: > Hi folks, > > I have a strange situation. When I add branches to the tree, everything > goes to the default class. > The error might be obvious, but I cannot find it. I would really > appreciate your help. I think it's the expected behaviour. > > this works, nothing goes to "1:9999": perhaps all the traffic you generate to test was marked by the iptables rules and then classified by that. btw in this order the rule for 192.168.200.0/24 never matches, because the rule for 192.168.0.0/16 matches always first. > ############################################################################# > /sbin/iptables -F -t mangle > /sbin/tc qdisc del dev eth1 root > /dev/null 2>&1 > /sbin/tc qdisc add dev eth1 root handle 1: htb default 9999 That's whats the default parameter is for ^^^^ Traffic not classified goes to the default. > /sbin/tc class add dev eth1 parent 1: classid 1:1 htb rate 100Mbit ceil 100Mbit > /sbin/tc class add dev eth1 parent 1:1 classid 1:9999 htb rate 128kbit > /sbin/tc class add dev eth1 parent 1:1 classid 1:4 htb rate 100Mbit > /sbin/tc class add dev eth1 parent 1:4 classid 1:28 htb rate 510kbit > # > /sbin/iptables -A POSTROUTING -o eth1 -t mangle -d 192.168.0.0/16 -j MARK --set-mark 4 > /sbin/tc filter add dev eth1 protocol ip parent 1:0 prio 3 handle 4 fw flowid 1:4 > # > /sbin/iptables -A POSTROUTING -o eth1 -t mangle -d 192.168.200.0/24 -j MARK --set-mark 28 > /sbin/tc filter add dev eth1 protocol ip parent 1:0 prio 3 handle 28 fw flowid 1:28 > ############################################################################# > > > > > when I add subclasses to "1:28", traffic goes to "1:34" and "1:35", but > exceeding traffic goes to "1:9999" instead of being placed at "1:28": > ############################################################################# > > /sbin/tc qdisc add dev eth1 root handle 1: htb default 9999 That's whats the default parameter is for ^^^^ Regards, Francisco. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/