From mboxrd@z Thu Jan 1 00:00:00 1970 From: don-lartc@isis.cs3-inc.com (Don Cohen) Date: Wed, 17 Apr 2002 15:57:42 +0000 Subject: Re: [LARTC] A tc htb/iptables rate control script for ADSL Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org > From: Martin Devera > I'm happy that HTB gained so much popularity ;) Only > one hint for you - you can completely avoid all these > tc filter add .... fw ... > You can use only one > tc filter add dev ppp0 parent 1: protocol ip prio 1 handle 1 fw > > and set classid directly in iptables like: > iptables -t mangle -A to-dsl -p tcp --dport 80 -j MARK --set-mark 0x10010 > iptables -t mangle -A to-dsl -p tcp --sport 24 -j MARK --set-mark 0x10020 > > and so on .. > devik > > > On 17 Apr 2002, alex wrote: > > > /sbin/iptables -t mangle -A to-dsl -p tcp --dport 22 -j MARK > > --set-mark 1 > > > > /sbin/iptables -t mangle -A to-dsl -p tcp --dport 80 -j MARK > > --set-mark 2 > > > > /sbin/tc filter add dev ppp0 parent 1: protocol ip prio 1 handle 1 > > fw classid 1:10 > > /sbin/tc filter add dev ppp0 parent 1: protocol ip prio 2 handle 2 > > fw classid 1:20 Is this documented anywhere? How/why does it work? I gather that the mark is interpreted as 16 bits of parent and 16 bits of class. But you couldn't you also have said something like this? iptables -t mangle -A to-dsl -p tcp --dport 80 -j MARK --set-mark 0x10010 /sbin/tc filter add dev ppp0 parent 1: protocol ip prio 1 handle 10 fw classid 1:20 ** **** Would that just not work? _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/