Код: Выделить всё
tc qdisc add dev eth0 root handle 1:0 cbq avpkt 10000 bandwidth 100mbit
tc qdisc add dev ppp0 root handle 2:0 cbq avpkt 10000 bandwidth 512kbit
tc class add dev eth0 parent 1:0 classid 1:101 cbq rate 256kbit allot 1500 bounded isolated
tc class add dev ppp0 parent 2:0 classid 2:201 cbq rate 256kbit allot 1500 bounded isolated
tc filter add dev eth0 parent 1:0 protocol ip handle 101 fw flowid 1:101
tc filter add dev ppp0 parent 2:0 protocol ip handle 201 fw flowid 2:201В таблице mangle определил параметры маркировки:
Код: Выделить всё
iptables -t mangle -A POSTROUTING -d 192.168.2.162 -s ! 192.168.0.0/21 -j MARK --set-mark 201
iptables -t mangle -A POSTROUTING -d 192.168.2.163 -s ! 192.168.0.0/21 -j MARK --set-mark 201
iptables -t mangle -A PREROUTING -s 192.168.2.162 -d ! 192.168.0.0/21 -j MARK --set-mark 101
iptables -t mangle -A PREROUTING -s 192.168.2.163 -d ! 192.168.0.0/21 -j MARK --set-mark 101