请选择 进入手机版 | 继续访问电脑版

[EdgeRouter - 企业级路由器CLI基础知识] QOS Advanced-Queue CLI 配置

[复制链接]
发表于 2016-8-8 13:45:13 | 显示全部楼层 |阅读模式
简介:

  • EdgeRouter 固件 1.8.0 以上版本支持 Advanced-Queue 功能
  • 开启 Advanced-Queue 会影响 offload 效能


工具:

EdgeRouter



网络拓扑说明:

  • eth1 : WAN - ISP 提供的静态 IP 地址/网关/ DNS(带宽上传 5M /下载 15M)
  • eth0 : LAN - 192.168.1.0/24


操作步骤:

1.限制整个 LAN 的上传和下载速度

(1)在 global 建立一个root queue 1
  1. set traffic-control advanced-queue root queue 1 attach-to global
  2. set traffic-control advanced-queue root queue 1 bandwidth 20mbit
复制代码
(2)分别建立 branch 100 上传和 200 下载

  1. set traffic-control advanced-queue branch queue 100 bandwidth 5mbit
  2. set traffic-control advanced-queue branch queue 100 description Upload
  3. set traffic-control advanced-queue branch queue 100 parent 1
  4. set traffic-control advanced-queue branch queue 200 bandwidth 15mbit
  5. set traffic-control advanced-queue branch queue 200 description Download
  6. set traffic-control advanced-queue branch queue 200 parent 1
复制代码
(3)在 root queue 1 中建立 filter 分别来应用 branch 100 和 200 配置
  1. set traffic-control advanced-queue filters match 100 attach-to 1
  2. set traffic-control advanced-queue filters match 100 description 'WAN upload'
  3. set traffic-control advanced-queue filters match 100 ip source address 192.168.1.0/24
  4. set traffic-control advanced-queue filters match 100 target 100
  5. set traffic-control advanced-queue filters match 200 attach-to 1
  6. set traffic-control advanced-queue filters match 200 description 'WAN download'
  7. set traffic-control advanced-queue filters match 200 ip destination address 192.168.1.0/24
  8. set traffic-control advanced-queue filters match 200 target 200
复制代码
(4)建立 FQ_CODEL queue 用于后续 leaf queues 使用
  1. set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN
  2. set traffic-control advanced-queue queue-type fq-codel FQCODEL_UP
复制代码
(5)分别建立 leaf queue 199 用于默认上传限速和 leaf queue 299 用于默认下载限速,并配置 queue 方式为 FQ_CODEL
  1. set traffic-control advanced-queue leaf queue 199 bandwidth 5mbit
  2. set traffic-control advanced-queue leaf queue 199 description default
  3. set traffic-control advanced-queue leaf queue 199 parent 100
  4. set traffic-control advanced-queue leaf queue 199 queue-type FQCODEL_UP
  5. set traffic-control advanced-queue leaf queue 299 bandwidth 15mbit
  6. set traffic-control advanced-queue leaf queue 299 description default
  7. set traffic-control advanced-queue leaf queue 299 parent 200
  8. set traffic-control advanced-queue leaf queue 299 queue-type FQCODEL_DOWN
复制代码
(6)在 branch100 中建立 filter 来应用 leaf 199,在 branch 200 中建立 filter 来应用 leaf 299 配置
  1. set traffic-control advanced-queue filters match 199 attach-to 100
  2. set traffic-control advanced-queue filters match 199 description Default
  3. set traffic-control advanced-queue filters match 199 target 199
  4. set traffic-control advanced-queue filters match 299 attach-to 200
  5. set traffic-control advanced-queue filters match 299 description Default
  6. set traffic-control advanced-queue filters match 299 target 299
复制代码
2.限制单个 IP 和文件传输应用上传速度

(1)建立 leaf queue 201和filter 用于配置IP地址为192.168.1.11的下载速度限制为4M
  1. set traffic-control advanced-queue leaf queue 201 bandwidth 4mbit
  2. set traffic-control advanced-queue leaf queue 201 description 192.168.1.11
  3. set traffic-control advanced-queue leaf queue 201 parent 200
  4. set traffic-control advanced-queue filters match 201 attach-to 200
  5. set traffic-control advanced-queue filters match 201 description 'limit 192.168.1.11'
  6. set traffic-control advanced-queue filters match 201 ip destination address 192.168.1.11/32
  7. set traffic-control advanced-queue filters match 201 target 201
复制代码
(2)建立 leaf queue 101和filter 用于配置文件传输的应用上传速度限制为2M
  1. set traffic-control advanced-queue leaf queue 101 bandwidth 2mbit
  2. set traffic-control advanced-queue leaf queue 101 description file-transfer
  3. set traffic-control advanced-queue leaf queue 101 parent 100
  4. set traffic-control advanced-queue filters match 101 application category File-Transfer
  5. set traffic-control advanced-queue filters match 101 attach-to 100
  6. set traffic-control advanced-queue filters match 101 description 'limit file-transfer'
  7. set traffic-control advanced-queue filters match 101 target 101
复制代码
3.移除 FQ_CODEL queue,而采用HFQ queue来配置LAN中每个IP的下载速度和上传速度(下载速度8Mbps,上传速度3Mbps)
  1. set traffic-control advanced-queue queue-type hfq HFQ_DOWN host-identifier dip
  2. set traffic-control advanced-queue queue-type hfq HFQ_DOWN max-rate 8mbit
  3. set traffic-control advanced-queue queue-type hfq HFQ_DOWN subnet 192.168.1.0/24
  4. set traffic-control advanced-queue leaf queue 299 queue-type HFQ_DOWN
  5. set traffic-control advanced-queue queue-type hfq HFQ_UP host-identifier sip
  6. set traffic-control advanced-queue queue-type hfq HFQ_UP max-rate 3mbit
  7. set traffic-control advanced-queue queue-type hfq HFQ_UP subnet 192.168.1.0/24
  8. set traffic-control advanced-queue leaf queue 199 queue-type HFQ_UP
复制代码
1234.png

备注:

1.配置某个网段每个 IP 统一限速,只需配置步骤 1 中 (1)-(6) 和步骤 3,HFQ 最多支持 /22 子网掩码。

2.配置 Advanced-Queue 后需要一定时间才能生效,取决于路由器配置文件大小所以生效时间快则几秒慢则几分钟。
3.leaf queue 的默认 queue 方式为 PFIFO
4.附件为ER-X-SFP均衡限速192.168.1.0/24的HFQ QOS配置,使用ER-X-SFP的用户可在下载后按需求更改 WAN 连接方式和限速配置(EdgeRouter 默认帐号 ubnt/ubnt)


edgeos_ubnt_20160808QOS.tar.gz (1.98 KB, 下载次数: 35)

相关帖子

UBNT 中文知识库: help.ubnt.com.cn/hc/zh-cn
UBNT 中文在线课堂:live.ubnt.com.cn
UBNT 英文知识库: help.ubnt.com
UBNT 全球社区: community.ubnt.com

使用道具 举报

优倍快网络技术咨询(上海)有限公司 沪ICP备13034452

© ubnt.com.cn All Rights Reserved.本站发布的所有内容,未经许可,不得转载.

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