海运的博客

ROS简单队列限速和PCQ动态限速配置/HTB队列树优先级限制

发布时间:July 28, 2012 // 分类:ROS // No Comments

1.ROS网络管理功能十分强大,如需简单对IP或网段进行限速可使用简单队列限速。

queue simple add target-addresses=192.168.0.0/24 limit-at=500000/1000000  max-limit=1000000/2000000 \
burst-threshold=1000000/1000000 burst-limit=1000000/3000000 burst-time=8/8 
#limit-at 限制在此速率
#max-limit 空闲时可用最大速率,未设置等于limit-at
#burst-threshold 速率阀值
#burst-limit 单位时间内速率低于阀值,可突破至此速率
#burst time 突破速率的时间间隔

2.使用简单限速用户较少时会造成带宽的浪费,为此可使用PCQ动态限速。

queue type add name=down-pcq kind=pcq pcq-rate=0 pcq-limit=50 pcq-total-limit=2000 pcq-classifier=dst-address
#PCQ下载队列,针对内部目标IP
#默认情况下仅能容纳50个用户,即2000/50,用户较多时可调整pcq-total-limit或pcq-limit数值
queue type add name=up-pcq kind=pcq pcq-rate=0 pcq-limit=50 pcq-total-limit=2000 pcq-classifier=src-address   
#PCQ上传队列,针对内部源IP
queue simple add name=pcq-queue target-addresses=192.168.1.0/24 max-limit=500000/1000000 queue=up-pcq/down-pcq
#新建简单队列应用PCQ规则

3.基于等级优先级HTB设置,可针对IP、协议进行限制。

ip firewall mangle add chain=forward action=mark-connection new-connection-mark=1.2 src-address=192.168.1.2 passthrough=yes 
ip firewall mangle add chain=forward action=mark-connection new-connection-mark=1.3 src-address=192.168.1.3 passthrough=yes 
#标记特定的连接
ip firewall mangle add chain=forward action=mark-packet new-packet-mark=1.2 connection-mark=1.3 passthrough=no 
ip firewall mangle add chain=forward action=mark-packet new-packet-mark=1.3 connection-mark=1.3 passthrough=no 
#标记特定连接的所有数据包

建立父队列:

queue tree add name=totaldown parent=ether2 limit-at=2000000 max-limit=2000000
queue tree add name=totalup parent=ether1 limit-at=500000 max-limit=500000 
#标记数据LAN为下载,WAN为上传
#Global-in识别Prerouting标记的数据
#Global-out/total能识别pre,forward,post标记的数据

建立子队列:

queue tree add name=pc1.2down parent=totaldown limit-at=2000000 max-limit=2000000 priority=2 
queue tree add name=pc1.2up parent=totalup limit-at=500000 max-limit=5555500000 priority=2 
queue tree add name=pc1.3down parent=totaldown  limit-at=1000000 max-limit=1000000 priority=3 
queue tree add name=pc1.3up parent=totalup  limit-at=500000 max-limit=500000 priority=3 

标签:ros, qos, pcq, ros带宽限制, htb

评论已关闭

分类
最新文章
最近回复
  • 海运: 恩山有很多。
  • swsend: 大佬可以分享一下固件吗,谢谢。
  • Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
  • 孤狼: 擦。。。。apcupsd会失联 nut在冲到到100的时候会ONBATT进入关机状态,我想想办...
  • 海运: 网络,找到相应的url编辑重发请求,firefox有此功能,其它未知。
  • knetxp: 用浏览器F12网络拦截或监听后编辑重发请求,修改url中的set为set_super,将POS...
  • Albert: 啊啊啊啊啊啊啊啊啊 我太激动了,终于好了英文区搜索了半天,翻遍了 pve 论坛没找到好方法,博...