<div id="RTEContent">Hello lartc maintainers and users!<br> I have a router with two NICs. One NIC is connected to the Internet and the other to my internal LAN. I made a script for priorizing interactive traffic. The script matches TOS Minimize-Delay for priorizing interactive trafic, and fwmark for metropolitan packets.<br> I have two root classes (simulating two circuits) : 1:1 for internet and 1:3 for metropolitan.<br> When I watch -n1 tc -s -d qdisc show, the classes that belong to metropolitan traffic (FE) on the two interfaces are not sending nor receiving any byte...<br> Can someone help me out this situation? I list my tc and iptables scripts below (for some reason I could't attach them - "Invalid file").<br> Thank you in advance!<br> ---------------------------------------------------------------------------------------------------------------------<br> my_script.sh:<br> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="Generator"
content="Kate, the KDE Advanced Text Editor"> <pre><span style="color: rgb(128, 128, 128);">#!/bin/bash</span> <span style="color: rgb(0, 128, 0);">tc=</span>/sbin/tc <span style="color: rgb(0, 128, 0);">u=</span>kbit <span style="color: rgb(0, 128, 0);">U=</span>Mbit <span style="color: rgb(0, 128, 0);">RATE=</span>256 <span style="color: rgb(0, 128, 0);">metro=</span>1 <span style="color: rgb(0, 23, 175);"><b>for</b></span> eth <span style="color: rgb(0, 23, 175);"><b>in</b></span> <b>`</b> <span style="color: rgb(136, 0, 136);"><b>echo</b></span> eth0 eth1 <span style="color: rgb(0, 23, 175);"><b>`</b></span>; <span style="color: rgb(0, 23, 175);"><b>do</b></span> <span style="color: rgb(0, 128, 0);">$tc</span> qdisc del dev <span style="color: rgb(0, 128, 0);">$eth</span> root <span style="color: rgb(34, 51, 136);"><b>&></b></span>/dev/null <span style="color: rgb(0, 128, 0);">$tc</span> qdisc add dev <span style="color: rgb(0, 128, 0);">$eth</span> root handle
1: htb default FF <span style="color: rgb(128, 128, 128);"># class default - non-priorized traffic</span> <span style="color: rgb(0, 128, 0);">$tc</span> class add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1: classid 1:1 htb rate <span style="color: rgb(0, 128, 0);">$RATE$u</span> ceil $[<span style="color: rgb(0, 128, 0);">$RATE</span>-16]<span style="color: rgb(0, 128, 0);">$u</span> <span style="color: rgb(0, 128, 0);">$tc</span> class add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1:1 classid 1:FF htb rate 1<span style="color: rgb(0, 128, 0);">$u</span> ceil $[<span style="color: rgb(0, 128, 0);">$RATE</span>-16]<span style="color: rgb(0, 128, 0);">$u</span> prio 1 <span style="color: rgb(0, 128, 0);">$tc</span> qdisc add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1:FF handle FF: sfq perturb 10 <span style="color: rgb(128, 128, 128);"># priorized traffic - Internet (TOS = Minimize-Delay)</span> <span
style="color: rgb(0, 128, 0);">$tc</span> class add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1:1 classid 1:2 htb rate $[<span style="color: rgb(0, 128, 0);">$RATE</span>-16]<span style="color: rgb(0, 128, 0);">$u</span> ceil $[<span style="color: rgb(0, 128, 0);">$RATE</span>-16]<span style="color: rgb(0, 128, 0);">$u</span> burst 16k prio 0 <span style="color: rgb(0, 128, 0);">$tc</span> filter add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1: protocol ip prio 1 u32 match ip tos 0x10 0xff flowid 1:2 <span style="color: rgb(0, 128, 0);">$tc</span> qdisc add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1:2 handle 2: sfq perturb 10 <span style="color: rgb(128, 128, 128);"># metropolitan (MARK = 1)</span> <span style="color: rgb(0, 128, 0);">$tc</span> class add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1: classid 1:3 htb rate 100<span style="color: rgb(0, 128, 0);">$U</span> ceil 99<span
style="color: rgb(0, 128, 0);">$U</span> <span style="color: rgb(0, 128, 0);">$tc</span> class add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1:3 classid 1:FE htb rate 99<span style="color: rgb(0, 128, 0);">$U</span> ceil 99<span style="color: rgb(0, 128, 0);">$U</span> <span style="color: rgb(0, 128, 0);">$tc</span> qdisc add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1:FE handle FE: sfq perturb 10 <span style="color: rgb(0, 128, 0);">$tc</span> filter add dev <span style="color: rgb(0, 128, 0);">$eth</span> parent 1: protocol ip prio 0 handle <span style="color: rgb(0, 128, 0);">$metro</span> fw flowid 1:FE <span style="color: rgb(0, 23, 175);"><b>done</b></span></pre>----------------------------------------------------------------------------------------------------------------------<br> output of iptables-save (mangle PREROUTING):<br> <br> -A PREROUTING -p tcp -m tcp --sport 80 -j TOS --set-tos 0x10<br> -A PREROUTING -p tcp -m tcp
--dport 80 -j TOS --set-tos 0x10<br> -A PREROUTING -p tcp -m tcp --dport 443 -j TOS --set-tos 0x10<br> -A PREROUTING -p tcp -m tcp --sport 443 -j TOS --set-tos 0x10<br> -A PREROUTING -p tcp -m tcp --sport 5050 -j TOS --set-tos 0x10<br> -A PREROUTING -p tcp -m tcp --dport 5050 -j TOS --set-tos 0x10<br> -A PREROUTING -p tcp -m tcp --dport 6667 -j TOS --set-tos 0x10<br> -A PREROUTING -p tcp -m tcp --sport 6667 -j TOS --set-tos 0x10<br> -A PREROUTING -p tcp -m tcp --tcp-flags SYN ACK -j TOS --set-tos 0x10<br> -A PREROUTING -s 82.77.124.128/255.255.255.224 -d 82.77.124.128/255.255.255.224 -j MARK --set-mark 0x1<br> -A PREROUTING -s 82.77.124.128/255.255.255.224 -d 193.226.0.0/255.255.0.0 -j MARK --set-mark 0x1<br> -A PREROUTING -s 193.226.0.0/255.255.0.0 -d 82.77.124.128/255.255.255.224 -j MARK --set-mark 0x1<br> -A PREROUTING -s 192.129.0.0/255.255.0.0 -d 82.77.124.128/255.255.255.224 -j MARK --set-mark 0x1<br> -A PREROUTING -s 82.77.124.128/255.255.255.224 -d 192.129.0.0/255.255.0.0 -j
MARK --set-mark 0x1<br> <br> </div><p>
                <hr size=1> <a href="http://us.lrd.yahoo.com/_ylc=X3oDMTFqODRtdXQ4BF9TAzMyOTc1MDIEX3MDOTY2ODgxNjkEcG9zAzEEc2VjA21haWwtZm9vdGVyBHNsawNmYw--/SIG=110oav78o/**http%3a//farechase.yahoo.com/">Yahoo! FareChase - Search multiple travel sites in one click.</a>