Skip to contentSkip to conversation

simple htb script which does not work

LARTC Ludovic Drolez 2 participants 2 messages Jun 5, 2002

lore
Share & tools
lore
#0 lore raw

Hi !

I'm using the htb.init script to do simple things with my adsl connection:
- uploads through a VPN (port 2001 used) can use all BW (128Kbits) (ratekbps, ceilkbps), class 10
- and others have only 8 kbits but can take all the BW if there is no VPN activity. (rate=1kbps, ceilkps), class 20

But, BW sharing does not seem to work, and if I make 2 uploads, one through the VPN, the other with ssh on the net, I get 8kbps/8kbps instead of 15kbps/1kbps.

Some stats show that packets are filtered the right way.

here's this simple script: (got it with 'htb.init compile')

tc qdisc del dev ppp0 root
tc qdisc add dev ppp0 root handle 1 htb default 20

tc class add dev ppp0 parent 1: classid 1:2 htb rate 16kbps mtu 1492

tc class add dev ppp0 parent 1:2 classid 1:10 htb rate 15kbps ceil 16kbps prio 1 mtu 1492
tc qdisc add dev ppp0 parent 1:10 handle 10 sfq perturb 10 tc filter add dev ppp0 parent 1:0 protocol ip prio 100 u32 match ip dport 2001 0xffff classid 1:10
tc filter add dev ppp0 parent 1:0 protocol ip prio 100 u32 match ip sport 2001 0xffff classid 1:10

tc class add dev ppp0 parent 1:2 classid 1:20 htb rate 1kbps ceil 16kbps prio 5 mtu 1492
tc qdisc add dev ppp0 parent 1:20 handle 20 sfq perturb 10

Any idea ?

Cheers,

Signature · 7 lines
Ludovic DROLEZ                                       Free&ALter Soft
152, rue de Grigy - Technopole Metz 2000                  57070 METZ
tel : 03 87 75 55 21                            fax : 03 87 75 19 26

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#1 lore raw
Quoted 9 lines · Ludovic Drolez

Hi !

I'm using the htb.init script to do simple things with my adsl connection:
- uploads through a VPN (port 2001 used) can use all BW (128Kbits) (rate=15kbps, ceil=16kbps), class 10
- and others have only 8 kbits but can take all the BW if there is no VPN activity. (rate=1kbps, ceil=16kps), class 20

Quoted 7 lines

But, BW sharing does not seem to work, and if I make 2 uploads, one through the VPN, the other with ssh on the net, I get 8kbps/8kbps instead of 15kbps/1kbps.

Some stats show that packets are filtered the right way.

Any idea ?

You need to shape lower then 16kbps so you never use the full bandwidth. Otherwise, the queues on you modem will be filled and it will be the modem that controls the bandwidth.

The scripts is OK.

Stef

Signature · 7 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/