Adaugi

$TC class add dev eth0 parent 10:0 classid 10:2 cbq rate $[100-$UPLD]Mbit weight 
        $UWEIGHT allot 1514 prio 1 avpkt 1000 split 10:0 defmap 3f


Da' clasificatorul u32 cu
    match ip src 192.168.1.0/24
ce are? Trebuia neaparat sa marchezi pachetele?

Narcis RADU wrote:

>Pe o placa de retea eth1 am doua clase
>
>eth1  -  10.0.0.0/24
>
>eth1:1 - 192.168.1.0/24
>
>Vreau sa limitez traficul pentru 192.168.1.0/24
>
>
>Eu am incercat cam asha:
>
>;----------- o bucata din scriptul cu tc-ul (/etc/init.d/limitare)
>TC=/sbin/tc
>DNLD=48Kbit             # DOWNLOAD Limit
>DWEIGHT=4Kbit           # DOWNLOAD Weight Factor ~ 1/10 of DOWNLOAD Limit
>UPLD=24KBit             # UPLOAD Limit
>UWEIGHT=2Kbit            # UPLOAD Weight Factor
>
>tc_start() {
>
>$TC qdisc add dev eth1 root handle 11: cbq bandwidth 100Mbit avpkt 1000 
>       mpu 64
>$TC class add dev eth1 parent 11:0 classid 11:1 cbq rate $DNLD weight 
>       $DWEIGHT allot 1514 prio 1 avpkt 1000 bounded
>$TC filter add dev eth1 parent 11:0 protocol ip handle 4 fw flowid 
>       11:1
>
>$TC qdisc add dev eth0 root handle 10: cbq bandwidth 100Mbit avpkt 1000
>        mpu 64
>$TC class add dev eth0 parent 10:0 classid 10:1 cbq rate $UPLD weight 
>       $UWEIGHT allot 1514 prio 1 avpkt 1000 bounded
>$TC filter add dev eth0 parent 10:0 protocol ip handle 3 fw flowid 10:1
>
>}
>
>;------------ si din firewall
># Vrajeala pentru CBQ
>/sbin/iptables -t mangle -A FORWARD -s 192.168.1.0/24 -j MARK --set-mark 3
>/sbin/iptables -t mangle -A POSTROUTING -s ! 192.168.1.0/24 -d 
>       192.168.1.0/24 -j MARK --set-mark 4
>
>
>Rezultatul a fost o limitare pentru tot eth1.
>
>Raman recunoscator celui care imi poate spune unde am gresit
>
>Narcis Radu
>
>
>
>--- 
>Detalii despre listele noastre de mail: http://www.lug.ro/
>
>  
>



--- 
Detalii despre listele noastre de mail: http://www.lug.ro/


Raspunde prin e-mail lui