先做好一個PCQ的限速
一個一個限制用simple queue
/ queue simple
add name="queue1" target-address=192.168.0.1/32 dst-address=0.0.0.0/0 /
interface=all queue=default PRiority=8 limit-at=330000/330000 /
max-limit=400000/400000 disabled=no
限制一個網(wǎng)段用PCQ
1. Mark all packets with flow all:用flow all 標(biāo)記所有數(shù)據(jù)包
/ip firewall mangle add action=accept mark-flow=all
2. Create two PCQ queue types - one for download and one for upload. For download traffic:創(chuàng)建兩條PCQ類型,下載和上傳
queues will be classified by dst-address and for upload - by src-address:
/queue type add name=PCQ-Download kind=pcq pcq-rate=768000 /
pcq-classifier=dst-address
/queue type add name=PCQ-Upload kind=pcq pcq-rate=512000 /
pcq-classifier=src-address
3. Add two queue rules - one for download and one for upload:添加PCQ規(guī)則,下載和上傳/
queue tree add parent=Local queue=PCQ-Download flow=all
/queue tree add parent=Public queue=PCQ-Upload flow=all
下邊在開始進(jìn)入正題
ROS的流量監(jiān)控只能監(jiān)控不同網(wǎng)卡的流量收發(fā)
假如wan口的帶寬是10M我們在9M的時候開啟控制條件.
/tool traffic-monitor
add name=pcqon interface=WAN on-event=pcqon threshold=9000000 trigger=above traffic=received
/system script add name="pcqon" source="/queue tree enable queue1 " owner="admin" policy=reboot,read,write,policy,test
在帶寬使用低于7M時關(guān)閉流量控制
/tool traffic-monitor
add name=pcqoff interface=WAN on-event=pcqoff threshold=7000000 trigger=below traffic=received
/system script add name="pcqoff" source="/queue tree disable queue1 " owner="admin" policy=reboot,read,write,policy,test
新聞熱點
疑難解答
圖片精選