发布网友 发布时间:2022-04-20 07:19
共2个回答
热心网友 时间:2023-06-23 11:53
本文原创,欢迎转载,欢迎指正,也欢迎朋友们来我QQ群78581508,一起讨论,一起分享。严重*视盗版,严肃建议百度进行盗版管理。
(13:29 2013/1/29 今早在网上看到我08年回答人家百度的问题,居然没回答完,并且该问题与另一个类似问题阅读数已经超过1000位,于是决定写个小东东给大家。)
该模拟环境的流控规则没有设定缓冲,有需要的可以设置下
硬件环境模拟:1 WAN 10m/10m bps add:192.168.3.111,1 LAN add-range:10.0.11.0/24,1 Web-server add:10.0.11.1,1 Manager-PC add:10.0.11.2,8 User-PC add-range:10.0.11.3-10.0.11.10
应用要求模拟:1 Web-server 上下行第一优先级,最高带宽占用*上下行9m/1m bps,1 manager 上下行第二优先级,带宽占用*上下行1m/2m bps,有空闲带宽时最高占用*上下行2m/9m bps,user 上下行第五优先级,使用pcq机制,带宽占用*上下行512k/1m bps,有空闲带宽时最高占用*上下行1m/9M bps,
#ROS 5.X
/interface
set ether1 name=LAN
set ether2 name=WAN
/ip address
add address=10.0.11.254/24 disabled=no interface=LAN network=10.0.11.0
add address=192.168.3.111/24 disabled=no interface=WAN network=192.168.3.0
/ip firewall mangle
add action=mark-packet chain=forward comment="wan all up" disabled=no in-interface=LAN new-packet-mark="wan all up" out-interface=WAN passthrough=yes
add action=mark-packet chain=forward comment="wan all down" disabled=no in-interface=WAN new-packet-mark="wan all down" out-interface=LAN passthrough=yes
add action=mark-packet chain=forward comment="web-server up" disabled=no new-packet-mark="web-server up" passthrough=yes src-address=10.0.11.1
add action=mark-packet chain=forward comment="web-server down" disabled=no dst-address=10.0.11.1 new-packet-mark="web-server down" passthrough=yes
add action=mark-packet chain=forward comment="manager up" disabled=no new-packet-mark="manager up" passthrough=yes src-address=10.0.11.2
add action=mark-packet chain=forward comment="manager up" disabled=no dst-address=10.0.11.2 new-packet-mark="manager down" passthrough=yes
add action=mark-packet chain=forward comment="user up pcq" disabled=no in-interface=LAN new-packet-mark="user up pcq" out-interface=WAN packet-mark=no-mark passthrough=yes
add action=mark-packet chain=forward comment="user down pcq" disabled=no in-interface=WAN new-packet-mark="user down pcq" out-interface=LAN packet-mark=no-mark passthrough=yes
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10M max-limit=10M name="wan all up" packet-mark="wan all up" parent=WAN priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10M max-limit=10M name="wan all down" packet-mark="wan all down" parent=WAN priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name="web-server up" packet-mark="web-server up" parent="wan all up" priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=1M name="web-server down" packet-mark="web-server down" parent="wan all down" priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=2M max-limit=9M name="manager down" packet-mark="manager down" parent="wan all down" priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=1M max-limit=2M name="manager up" packet-mark="manager up" parent="wan all up" priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=1M max-limit=9M name="user down pcq" packet-mark="user down pcq" parent="wan all down" priority=5 queue="user down pcq"
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=512k max-limit=1M name="user up pcq" packet-mark="user up pcq" parent="wan all up" priority=5 queue="user up pcq"
/queue type
add kind=pcq name="user up pcq" pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask= pcq-limit=50 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask= pcq-total-limit=2000
add kind=pcq name="user down pcq" pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask= pcq-limit=50 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask= pcq-total-limit=2000
热心网友 时间:2023-06-23 11:53
没有那个功能吧