From: Christof Schulze Date: Wed, 16 Jul 2014 08:44:10 +0000 Subject: iptables -j CLASSIFY vs tc htb Message-Id: <3157187.OeKFekvS3C@lappi> MIME-Version: 1 Content-Type: multipart/mixed; boundary="nextPart37992335.B7HWRdJodf" List-Id: To: lartc@vger.kernel.org --nextPart37992335.B7HWRdJodf Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Hi everyone, This is my first post to this list. I would like to set up the following scenario: 1. One Openwrt-Router (including the multiwan-package) is connected to two different DSL-Lines. 2. The DSL-Line shall be used in parallel. Multiwan will mark IP Connections and based on this marking a routingtable is selected tha= t defines which dsl line is used. 3. Traffic shaping shall be used on each DSL uplink. =20 I am having trouble with (3). Since -j MARK is already used to determin= e the correct routingtable the correct traffic class can either be determined by using tc u32 filters (which does not completely fulfill the needed rules) or by using the iptables -j CLASSIFY --set-classid major:minor-way. However I am experiencing the same symptoms like in this old thread:=20= http://mailman.ds9a.nl/pipermail/lartc/2006q2/018965.html The chain that executes --set-classid is being executed on the traffic (verified by using -j LOG) but the packets are still only placed in the= default traffic class 1:14. I am using this script to set up the classes & classify-rules. The example is shortened. for ((i=3D2;i<10;i+=3D1)) do /sbin/tc class add dev $OUTDEV parent 1:1 classid 1:$i htb rate 5kbps= ceil=20 10kbps burst 20k=20 /sbin/tc qdisc add dev $OUTDEV parent 1:${i} handle ${i} sfq perturb = 60 iptables -X mark_${i} -t mangle iptables -N mark_${i} -t mangle iptables -t mangle -A mark_$i -j LOG --log-level info --log-prefix = "packet=20 class $i " iptables -t mangle -A mark_$i -j CLASSIFY --set-class 1:${i} done iptables -t mangle -X markchain iptables -t mangle -N markchain iptables -t mangle -A POSTROUTING -o $OUTDEV -j markchain # match ssh taking into consideration whether the packet is marked as b= ulk iptables -t mangle -A markchain -p tcp --dport 22 -j CLASSIFY --set-cla= ss 1:13 iptables -t mangle -A markchain -p tcp --sport 22 -j CLASSIFY --set-cla= ss 1:13 iptables -t mangle -A markchain -p tcp -m tos --tos Maximize-Throughput= -j=20 CLASSIFY --set-class 1:17 What can I do to make shaping work in this environment? Christof =20 =2D-=20 () ascii ribbon campaign - against html e-mail /\ against proprietary attachments --nextPart37992335.B7HWRdJodf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEABECAAYFAlPGO1sACgkQpZfyPAmdZJmyBwCcCcc/t/+N+Hj10F5JXdjN4fjI MJkAn27OGyzoXy/kfPx2ksuWpisN5xh+ =Udob -----END PGP SIGNATURE----- --nextPart37992335.B7HWRdJodf--