HTB configuration problem
Hello,
I've got a lan + routrer (Mandrake 10.1) + 64 kB/s channel. I want to shape traffic among users, so I've given the highest priority to the http traffic - rate 40kbps ceil 64kbps, then I've limited the usage of th external ftp server ip 212.59.13.36 to rate 8kbps ceil 8kbps (I want everyone to use my local ftp rather than external), finally I've given rate 16kbps ceil 24kbps to all the other traffic. So I've written a script and put it into etc/rc.d/rc.local: # eth1 is plugged to DSL tc qdisc add dev eth1 root handle 1: htb default 4 tc class add dev eth1 parent 1: classid 1:1 htb rate 64kbps ceil 64kbps tc class add dev eth1 parent 1:1 classid 1:2 htb rate 40kbps ceil 64kbps prio 1 tc class add dev eth1 parent 1:1 classid 1:3 htb rate 8kbps ceil 8kbps prio 3 tc class add dev eth1 parent 1:1 classid 1:4 htb rate 16kbps ceil 24kbps prio 2 tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip sport 80 0xffff flowid 1:2 tc filter add dev eth1 protocol ip parent 1:0 prio 3 u32 match ip src 212.59.13.36 match ip dst 192.168.0.0/24 flowid 1:3 tc qdisc add dev eth1 parent 1:2 handle 2: sfq perturb 10 tc qdisc add dev eth1 parent 1:3 handle 3: sfq perturb 10 tc qdisc add dev eth1 parent 1:4 handle 4: sfq perturb 10 But it doesn't work. It doesn't shape any traffic, moreover whenever anyone is connected to that ftp the channel is usually congested and it is impossible to browse inet. Please, help if you can. Thanks in advance. |
Hi,
I may be all wrong, but are your users on your local LAN and downloading from a remote FTP server ? If so, then QoS won't help very much, since there's no point to use QoS on incomming trafic from a DSL line. The heavy trafic you have is incomming trafic from the ftp server, but when it hits your Linux box (or QoS enabled router) the harm is allready done : ftp trafic has used your DSL bandwidth, it's only dropped when incomming your box... QoS on icoming trafic can only have a meaning if both your network links have the same rate. If you wabt to have real QoS in your case, you enable it on your ftp server also. In case I misunderstood you, please forgive me. |
With that script of yours, you're only shaping what users are sending to the internet, and not what they are receiving from the internet. So it doesn't do anything for http which is download traffic, and nothing for ftp downloads. It should do something for ftp uploads, though, as long as those filter rules work.
To affect download traffic, you'll have to shape incoming packets, if you are on a router probably by shaping outgoing traffic of the LAN interface. @fr_laz while it is true that shaping incoming traffic like that isn't the optimal solution, reordering / dropping incoming packets on the router can improve usability a lot. |
Hi
Quote:
I'll try your script too. I also wanted to have a look at hping, that's the moment to set up a lab ;) |
All times are GMT -5. The time now is 08:30 AM. |