找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 3512|回复: 3

wr-tl720n 簡單QOS

[复制链接]
发表于 2013-7-19 22:23 | 显示全部楼层 |阅读模式
本帖最后由 秦时老猫 于 2013-7-22 13:06 编辑

需要安裝的app:iptables tc
adsl: 4M
4mbps = 512kb/s

/etc/rc.local:
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
insmod cls_basic
insmod cls_fw
insmod cls_route
insmod sch_htb
insmod sch_sfq


#DOWN
tc qdisc del dev br-lan root 2>/dev/null
tc qdisc add dev br-lan root handle 10: htb default 20
tc class add dev br-lan parent 10: classid 10:1 htb rate 500kbps ceil 600kbps


tc class add dev br-lan parent 10:1 classid 10:10 htb rate 300kbps ceil 600kbps prio 0
tc class add dev br-lan parent 10:1 classid 10:20 htb rate 100kbps ceil 300kbps prio 1
tc class add dev br-lan parent 10:1 classid 10:30 htb rate 10kbps ceil 20kbps prio 2


tc qdisc add dev br-lan parent 10:10 handle 101:  sfq perturb 10
tc qdisc add dev br-lan parent 10:20 handle 102:  sfq perturb 10
tc qdisc add dev br-lan parent 10:30 handle 103:  sfq perturb 10


#tc filter add dev br-lan parent 10: protocol ip prio 100 handle 10 fw classid 10:10
#tc filter add dev br-lan parent 10: protocol ip prio 100 handle 20 fw classid 10:20
#tc filter add dev br-lan parent 10: protocol ip prio 100 handle 30 fw classid 10:30




#UP
tc qdisc del dev eth2 root 2>/dev/null
tc qdisc add dev eth2 root handle 20: htb default 20
tc class add dev eth2 parent 20: classid 20:1 htb rate 128kbps ceil 500kbps
tc class add dev eth2 parent 20:1 classid 20:10 htb rate 100kbps ceil 500kbps prio 0
tc class add dev eth2 parent 20:1 classid 20:20 htb rate 18kbps ceil 300kbps prio 1
tc class add dev eth2 parent 20:1 classid 20:30 htb rate 10kbps ceil 10kbps prio 2


tc qdisc add dev eth2 parent 20:10 handle 101:  sfq perturb 10
tc qdisc add dev eth2 parent 20:20 handle 102:  sfq perturb 10
tc qdisc add dev eth2 parent 20:30 handle 103:  sfq perturb 10


tc filter add dev eth2 parent 20: protocol ip prio 100 handle 10 fw classid 20:10
tc filter add dev eth2 parent 20: protocol ip prio 100 handle 20 fw classid 20:20
tc filter add dev eth2 parent 20: protocol ip prio 100 handle 30 fw classid 20:30






##MARK
iptables -F -t mangle
iptables -t mangle -A POSTROUTING -d 101.210.10.0/24 -j CLASSIFY --set-class 10:30
iptables -t mangle -A POSTROUTING -d 101.210.10.6 -j CLASSIFY --set-class 10:10
iptables -t mangle -A POSTROUTING -d 101.210.10.5 -j CLASSIFY --set-class 10:20
iptables -t mangle -A POSTROUTING -d 101.210.10.7 -j CLASSIFY --set-class 10:20




iptables -t mangle -A PREROUTING -m tos --tos Minimize-Delay -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -m tos --tos Minimize-Cost -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -m tos --tos Minimize-Cost -j RETURN
iptables -t mangle -I PREROUTING -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j MARK --set-mark 10
iptables -t mangle -I PREROUTING -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j RETURN


iptables -t mangle -A PREROUTING -p udp -m udp --dport 53 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 80 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 80 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 443 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 443 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 8080 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 8080 -j MARK --set-mark 10


iptables -t mangle -A PREROUTING -s 101.210.10.0/24 -j MARK --set-mark 30
iptables -t mangle -A PREROUTING -s 101.210.10.6 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 101.210.10.5 -j MARK --set-mark 20
iptables -t mangle -A PREROUTING -s 101.210.10.7 -j MARK --set-mark 20


============================================================

參考:http://chunchaichang.blogspot.com/2010/08/qos.html








我的恩山、我的无线 The best wifi forum is right here.
发表于 2013-7-20 08:37 来自手机 | 显示全部楼层
全代码,太不直观了吧
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2013-7-20 09:11 | 显示全部楼层
fclql 发表于 2013-7-20 08:37
全代码,太不直观了吧

本人比較菜~ 寫不出來圖形的... 見諒見諒!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2013-7-22 11:14 | 显示全部楼层
谢谢,太高级了,这个要有空时再慢慢消化才行。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-20 00:05

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表