|
@ -10,10 +10,17 @@ URL=http://127.0.0.1/file |
|
|
mkdir -p tmp |
|
|
mkdir -p tmp |
|
|
|
|
|
|
|
|
type tc 2> /dev/null && ( |
|
|
type tc 2> /dev/null && ( |
|
|
tc qdisc add dev $DEV root handle 1: prio |
|
|
tc qdisc add dev $DEV root handle 1: htb |
|
|
tc qdisc add dev $DEV parent 1:3 handle 30: netem delay $DELAY |
|
|
tc class add dev $DEV parent 1: classid 1:1 htb rate 2mbps |
|
|
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:3 |
|
|
tc class add dev $DEV parent 1:1 classid 1:6 htb rate 2mbps ceil 1mbps prio 0 |
|
|
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip sport $PORT 0xffff flowid 1:3 |
|
|
tc filter add dev $DEV parent 1:0 prio 0 protocol ip handle 6 fw flowid 1:6 |
|
|
|
|
|
|
|
|
|
|
|
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:6 |
|
|
|
|
|
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip sport $PORT 0xffff flowid 1:6 |
|
|
|
|
|
|
|
|
|
|
|
# iptables -D OUTPUT -t mangle -p tcp --sport 8388 -j MARK --set-mark 6 |
|
|
|
|
|
# iptables -A OUTPUT -t mangle -p tcp --sport 8388 -j MARK --set-mark 6 |
|
|
|
|
|
|
|
|
tc qdisc show dev lo |
|
|
tc qdisc show dev lo |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|