- 论坛徽章:
- 0
|
iptables -t mangle -I PREROUTING -p udp --sport 21 -j MARK --set-mark 0x1
iptables -t mangle -I PREROUTING -p udp --sport 21 -j RETURN
iptables -t mangle -I PREROUTING -p udp --dport 21 -j MARK --set-mark 0x1
iptables -t mangle -I PREROUTING -p udp --dport 21 -j RETURN
iptables -t mangle -I PREROUTING -p udp --sport 80 -j MARK --set-mark 0x2
iptables -t mangle -I PREROUTING -p udp --sport 80 -j RETURN
iptables -t mangle -I PREROUTING -p udp --dport 80 -j MARK --set-mark 0x2
iptables -t mangle -I PREROUTING -p udp --dport 80 -j RETURN
iptables -t mangle -I OUTPUT -p udp --sport 21 -j MARK --set-mark 0x1
iptables -t mangle -I OUTPUT -p udp --sport 21 -j RETURN
iptables -t mangle -I OUTPUT -p udp --dport 21 -j MARK --set-mark 0x1
iptables -t mangle -I OUTPUT -p udp --dport 21 -j RETURN
iptables -t mangle -I OUTPUT -p udp --sport 80 -j MARK --set-mark 0x2
iptables -t mangle -I OUTPUT -p udp --sport 80 -j RETURN
iptables -t mangle -I OUTPUT -p udp --dport 80 -j MARK --set-mark 0x2
iptables -t mangle -I OUTPUT -p udp --dport 80 -j RETURN
tc qdisc del dev eth2 root
tc qdisc add dev eth2 root handle 1: cbq bandwidth 10Mbit avpkt 1000 cell 8 mpu 64
tc class add dev eth2 parent 1:0 classid 1:1 cbq bandwidth 10Mbit rate 10Mbit allot 1514 weight 1Mbit prio 8 maxburst 200 avpkt 1000 bounded
tc class add dev eth2 parent 1:1 classid 1:2 cbq bandwidth 10Mbit rate 9Mbit allot 1514 weight 0.9Mbit prio 6 maxburst 8 avpkt 1000
tc class add dev eth2 parent 1:1 classid 1:3 cbq bandwidth 10Mbit rate 64Kbit allot 1514 weight 6.4Kbit prio 2 maxburst 200 avpkt 160 bounded
tc qdisc add dev eth2 parent 1:2 sfq quantum 1514b perturb 15
tc qdisc add dev eth2 parent 1:3 sfq quantum 1514b perturb 15
tc filter add dev eth2 parent 1:0 protocol ip prio 1 handle 1 fw classid 1:2
tc filter add dev eth2 parent 1:0 protocol ip prio 2 handle 2 fw classid 1:3
eth2是wan口,从lan口向eth2用上述命令打流量,在wan口eth2也可以接收到21端口和80端口数据,但在串口中发现两个队列数据均为0,21端口和80端口数据都没有进入队列,为什么呢?即使把mangle表的OUTPUT链内容去掉也不行。
# tc -s qdisc ls dev eth2
qdisc cbq 1: rate 10000Kbit (bounded,isolated) prio no-transmit
Sent 1897468 bytes 9406 pkts (dropped 0, overlimits 0)
borrowed 0 overactions 0 avgidle 597 undertime 0
qdisc sfq 8001: parent 1:2 limit 128p quantum 1514b perturb 15sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc sfq 8002: parent 1:3 limit 128p quantum 1514b perturb 15sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
# tc -s class ls dev eth2
class cbq 1: root rate 10000Kbit (bounded,isolated) prio no-transmit
Sent 1897468 bytes 9406 pkts (dropped 0, overlimits 0)
borrowed 0 overactions 0 avgidle 597 undertime 0
class cbq 1:1 parent 1: rate 10000Kbit (bounded) prio no-transmit
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
borrowed 0 overactions 0 avgidle 655 undertime 0
class cbq 1:2 parent 1:1 leaf 8001: rate 9000Kbit prio 6
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
borrowed 0 overactions 0 avgidle 673 undertime 0
class cbq 1:3 parent 1:1 leaf 8002: rate 64000bit prio 1
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
borrowed 0 overactions 0 avgidle 2.97632e+08 undertime 0
[ 本帖最后由 jhunix008 于 2008-10-29 09:24 编辑 ] |
|