Re: Shaping per machine

Linux Advanced Routing and Traffic Control

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

 



Dnia niedziela, 4 grudnia 2005 23:11, Dave Weis napisał(a): 

> I'm trying to shape each machine on an interface to 256k each, but I'm
> getting stuck and only able to shape an entire interface to 256k. What
> should I be doing differently here?
>
> tc qdisc del dev eth0 root
>
> tc qdisc add dev eth0 root handle 1: htb default 10
>
> tc class add dev eth0 parent 1: classid 1:1 htb rate 100MBit ceil 100MBit
>
> tc qdisc add dev eth0 parent 1:10 handle 110: sfq perturb 10
>
> tc class add dev eth0 parent 1:1 classid 1:10 htb \
>          rate 256kbit ceil 256kbit prio 0
>
> tc filter add dev eth0 parent 1:0 protocol ip pref 1 u32 \
>          match ip src 10.7.15.0/24 flowid 1:10

That's because you are putting all /24 network into one single HTB. You have 
to make one HTB (SFQ for every user helps a lot too) for each computer in the 
network:

tc qdisc del root dev eth1 
tc qdisc add root dev eth1 handle 1: htb default 1
tc class add dev eth1 parent 1: classid 1:1 htb \
 rate 1000Mbit ceil 1000Mbit burst 100kbit

tc class add dev eth1 parent 1:1 classid 1:2 htb \
 rate 64kbit ceil 256kbit quantum 2000 burst 10kbit
tc qdisc add dev eth1 parent 1:2 handle 2: sfq perturb 5 quantum 1500b

tc class add dev eth1 parent 1:1 classid 1:3 htb \
 rate 80kbit ceil 320kbit quantum 2000 burst 10kbit
tc qdisc add dev eth1 parent 1:3 handle 3: sfq perturb 5 quantum 1500b

...

tc class add dev eth1 parent 1:1 classid 1:254 htb \
 rate 64kbit ceil 256kbit quantum 2000 burst 10kbit
tc qdisc add dev eth1 parent 1:254 handle 254: sfq perturb 5 quantum 1500b


Putting all computers to proper HTBs with separate filters can make high load 
on your machine, so it is best to use hashing filters.


-- 
| pozdrawiam / greetings | powered by Trustix, Gentoo and FreeBSD |
|  Kajetan Staszkiewicz  | JID: vegeta@xxxxxxxxx                  |
|        Vegeta          | IMQ devnames: http://tuxpowered.net    |
`------------------------^----------------------------------------'
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


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