Re: Weighted packet shaping?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark Williams (MWP) wrote:


Are you sure that FTP is going to class 22 and not default -

tc -s qdisc ls dev $INTERFACE or tc -s class ls dev $INTERFACE will show counters.


I am.
I graph using "tc -s qdisc show dev ppp0" with rrdtool.

Ahh, I assume you patched and recompiled your 2.6.8.1.

I just tried the script below on 2.4.24 and 2.6.8.1 and it works as I expect.

I checked rates with iptraf and tc -s class ls dev ppp0. If you use htb's rate counter than be aware it uses a long average >60 sec and I notice that on my 2.6.8.1 setup it says bit where it probably should say bps (= bytes per sec).

Does it work for you ?

If you want to graph then add some queues.

Andy.

TC=/sbin/tc
IPTABLES=/usr/local/sbin/iptables


$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp --src 192.168.0.2 -j MARK --set-mark 21 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp --src 192.168.0.3 -j MARK --set-mark 22 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p ! tcp -j MARK --set-mark 20 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp -m length --length :128 -j MARK --set-mark 20 &>/dev/null


$TC qdisc del dev ppp0 root &>/dev/null

if ( [ "$1" = "stop" ] )
then
        exit
fi

$TC qdisc add dev ppp0 root handle 1: htb default 23
$TC class add dev ppp0 parent 1: classid 1:1 htb rate 220kbit
$TC class add dev ppp0 parent 1:1 classid 1:20 htb rate 120kbit ceil 220kbit prio 1
$TC class add dev ppp0 parent 1:1 classid 1:21 htb rate 50kbit ceil 220kbit prio 2
$TC class add dev ppp0 parent 1:1 classid 1:22 htb rate 25kbit ceil 220kbit prio 3
$TC class add dev ppp0 parent 1:1 classid 1:23 htb rate 25kbit ceil 220kbit prio 4


$TC filter add dev ppp0 parent 1:0 prio 0 protocol ip handle 20 fw flowid 1:20
$TC filter add dev ppp0 parent 1:0 prio 1 protocol ip handle 21 fw flowid 1:21
$TC filter add dev ppp0 parent 1:0 prio 2 protocol ip handle 22 fw flowid 1:22


$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp --src 192.168.0.2 -j MARK --set-mark 21
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp --src 192.168.0.3 -j MARK --set-mark 22
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p ! tcp -j MARK --set-mark 20
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp -m length --length :128 -j MARK --set-mark 20




_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux