On Monday 31 March 2003 11:12, liang jian wrote: > >> Yes ,that is my means :),my english is poor > > > >No problem. > > > >I have some remarks. Why not let the 4 classes borrow unused bandwidth > > from each other? So if there is no other traffic then ftp, ftp can get > > 10Mbps. But as soone as there is some other traffic, the ftp traffic goes > > down. > > > >And if you want 4 isolated classes, why not just creating the 4 classes > > like this : > > > >20:1 > >20:200 20:201 20:210 20:211 > > > >You have to create the htb (or cbq) classes. FIltering the traffic and > >placing in the classes is easy (you can filter on ports). Except maybe for > >the ftp traffic because that uses dynamic ports. > > Stef: > Thanks for your answer me quickly! > I have others question :) I have some problems understanding your english. Can you post your htb and iptabels script so I can understand what you did? > I apologize that it will take time. > My topological look like this: > Local:192.168.1.2----------|eth0:192.168.1.1 Linux Box > eth1:172.16.1.1|------Internet > > I have create a default 200 > > 20:1 (4kbps) > 200:200 200:201 200:210 200:211 > (1kbps) (1kbps) (1kbps) (1kbps) > > I have 10Mbps on the eth1,but I want to test htb,so I do that: > tc class add dev eth0 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps 4 and 1 kbps is __very__ low. It's too low for htb to get some results. > 200:201 mark with 7,then > iptables -t mangle -A FORWARD -p tcp -o eth0 -s 0/0 --dport 80 -d 0/0 -j > MARK --set-mark 7 > iptables -t mangle -A PREROUTING -p tcp -i eth0 -s 0/0 > --dport 80 -d 0/0 -j MARK --set-mark 7 > > why all traffic from default 200 to Internet.(the iptables rules like no > use) So all traffic ends up in 200:200 ?? You can check with iptables -L -v -n if your iptables rules are matched. If the iptables rule match, the byte and packet counters will increase. > ------------------------------------------------ > > If I use it on eth1 interface iptables rules work!?(though I have default > class 200 but all traffice from 200:201 to Internet.) other question it > that: > In this settings use Local machine 192.168.1.2 download some soft from > Internet.why it rate overrun 1kbps? Because 1kbps is too low for htb. And you have to mark packets in POSTROUTING. Local generated packets don't travel thru forward or prerouting. See kptd on www.docum.org. > Rules like this: > tc class add dev eth1 parent 20: classid 20:1 htb rate 4kbps ceil 4kbps > > iptables -t mangle -A FORWARD -p tcp -o eth1 -s 0/0 --dport 80 -d 0/0 -j > MARK --set-mark 7 iptables -t mangle -A PREROUTING -p tcp -i eth1 -s 0/0 > --dport 80 -d 0/0 -j MARK --set-mark 7 > > tc can only shape outgoing traffic(My settings which is my outgoing > traffic,eth1 or eth0?) Maybe I mix them I need path kernel with IMQ? You can indeed only shape outgoing traffic. Or you need the imq device. But if you shape on eth0 and eth1 you control both directions. So you don't need the imq device. Stef -- stef.coene@xxxxxxxxx "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net