Skip to content

Commit 2cc7ee5

Browse files
author
clowwindy
committed
alter tc rule
1 parent 9b3944c commit 2cc7ee5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/test_large_file.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ URL=http://127.0.0.1/file
1010
mkdir -p tmp
1111

1212
type tc 2> /dev/null && (
13-
tc qdisc add dev $DEV root handle 1: prio
14-
tc qdisc add dev $DEV parent 1:3 handle 30: netem delay $DELAY
15-
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:3
16-
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip sport $PORT 0xffff flowid 1:3
13+
tc qdisc add dev $DEV root handle 1: htb
14+
tc class add dev $DEV parent 1: classid 1:1 htb rate 2mbps
15+
tc class add dev $DEV parent 1:1 classid 1:6 htb rate 2mbps ceil 1mbps prio 0
16+
tc filter add dev $DEV parent 1:0 prio 0 protocol ip handle 6 fw flowid 1:6
17+
18+
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:6
19+
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip sport $PORT 0xffff flowid 1:6
20+
21+
# iptables -D OUTPUT -t mangle -p tcp --sport 8388 -j MARK --set-mark 6
22+
# iptables -A OUTPUT -t mangle -p tcp --sport 8388 -j MARK --set-mark 6
23+
1724
tc qdisc show dev lo
1825
)
1926

0 commit comments

Comments
 (0)