« -: Jan 04, 2007, 09:44 »
Zdrawejte, moze li njakoj da mi pomogne sys konfiguriraneto na shejpura 4e ne6to ne uspjawam da go pusna kak trjbwa.
Problemyt e 4e ne deli skorostite na BG i INT kato predi towa sym markiral trafika w firewalla:
int: iptables -t mangle -A PPEROUTING -i eth1 -j MARK --set-mark 0x2
BG: iptables -t mangle -A PPEROUTING -i eth1 -s /BG network/ -j MARK --set-mark 0x1; tozi red se powtarja za ws BG mrezi
A shejpura e :
.........
$tc qdisc add dev $dev root handle 1: htb default 10 r2q 5
all=1280kbps
bg_=1024kbps
bg_www=10kbps
bg_other=10kbps
int=256kbps
int_www=5kbps
int_other=5kbps
$tc class add dev $dev parent 1: classid 1:1 htb rate $all burst 6k
#bg
$tc class add dev $dev parent 1:1 classid 1:10 htb rate $bg_ ceil $bg_ burst 6k prio 2
$tc qdisc add dev $dev parent 1:10 handle 10: sfq perturb 10
$tc filter add dev $dev parent 1:1 protocol ip prio 2 handle 0x1 fw flowid 1:10
$tc class add dev $dev parent 1:10 classid 1:12 htb rate $bg_www ceil $bg_ burst 6k prio 4
$tc qdisc add dev $dev parent 1:12 handle 12: sfq perturb 10
$tc filter add dev $dev parent 1: protocol ip prio 4 u32 \
match ip dst 192.168.0.1/24 match ip dport 80 0xff flowid 1:12
$tc class add dev $dev parent 1:10 classid 1:13 htb rate $bg_other ceil $bg_ burst 6k prio 6
$tc qdisc add dev $dev parent 1:13 handle 13: sfq perturb 10
$tc filter add dev $dev parent 1: protocol ip prio 6 u32 \
match ip dst 192.168.0.1/24 flowid 1:10
#int
$tc class add dev $dev parent 1:1 classid 1:11 htb rate $int ceil $int burst 6k prio 3
$tc qdisc add dev $dev parent 1:11 handle 11: sfq perturb 10
$tc filter add dev $dev parent 1:1 protocol ip prio 3 handle 0x2 fw flowid 1:11
$tc class add dev $dev parent 1:11 classid 1:14 htb rate $int_www ceil $int burst 6k prio 1
$tc qdisc add dev $dev parent 1:14 handle 14: sfq perturb 10
$tc filter add dev $dev parent 1:0 protocol ip prio 5 u32 \
match ip dst 192.168.0.1/24 match ip dport 80 0xff flowid 1:14
$tc class add dev $dev parent 1:11 classid 1:15 htb rate $int_other ceil $int burst 6k prio 1
$tc qdisc add dev $dev parent 1:15 handle 15: sfq perturb 10
$tc filter add dev $dev parent 1:0 protocol ip prio 7 u32 \
match ip dst 192.168.0.1/24 flowid 1:15
# OUT
all1=768kbps
www1=5kbps
other1=5kbps
$tc qdisc add dev $dev1 root handle 2: htb default 90
$tc class add dev $dev1 parent 2: classid 2:1 htb rate $all1 burst 6k
$tc class add dev $dev1 parent 2:1 classid 2:10 htb rate $other1 ceil $all1 burst 6k prio 8
$tc qdisc add dev $dev1 parent 2:10 handle 10: sfq perturb 10
$tc filter add dev $dev1 parent 2: protocol ip prio 9 u32 \
match ip src 192.168.0.1/24 flowid 2:10
$tc class add dev $dev1 parent 2:1 classid 2:90 htb rate $www1 ceil $all1 burst 6k prio 1
$tc qdisc add dev $dev1 parent 2:90 handle 90: sfq perturb 10
$tc filter add dev $dev1 parent 2: protocol ip prio 2 u32 \
match ip sport 80 0xff flowid 2:90
$tc qdisc add dev $dev1 ingress
........