Lesson 03: Bandwidth Manage
Simple Queues
HTB/CBQ
PCQ Based Queues
Bandwidth Control: Day night package
Dedicate
Shared Control
Burst Limit
Simple Queues/queue simple
add limit-at=64k/64k max-limit=128k/128k name=192.168.1.10 target=192.168.1.10/32
add limit-at=64k/64k max-limit=128k/128k name=192.168.1.11 target=192.168.1.11/32
add max-limit=64k/64k name=192.168.1.0/24 target=192.168.1.0/24
HTB (Hierarchical Token Bucket) /CBQ (Class-Based Queuing)HTB Diagram:
add limit-at=32k max-limit=256k name=Leaf2-DL packet-mark=Linux-2 parent=Inner1-DL
add kind=pcq name=DL-128k pcq-classifier=dst-address
add kind=pcq name=UL-128k pcq-classifier=src-address
/queue simple
add name=Main target=""
add limit-at=256k/256k max-limit=512k/512k name=192.168.1.10 parent=Main target=192
add limit-at=256k/256k max-limit=512k/512k name=192.168.1.0/24 parent=Main queue=U
128k target=192.168.1.0/24
add limit-at=64k/64k max-limit=128k/128k name=Day target=192.168.1.0/24
add limit-at=128k/128k max-limit=256k/256k name=Night target=192.168.1.0/24
/system script
add name=Day source="/queue simple enable Day; /queue simple disable Night"
add name=Night source=\"/queue simple enable Night; /queue simple disable Day"
/system scheduler
add interval=1d name=Day on-event=Day start-date=oct/14/2016 start-time=06:00:00
add interval=1d name=Night on-event=Night start-date=oct/14/2016 start-time=18:00:00
add limit-at=64k/64k max-limit=128k/128k name=192.168.1.10 target=192.168.1.10/32
add limit-at=64k/64k max-limit=128k/128k name=192.168.1.11 target=192.168.1.11/32
add max-limit=64k/64k name=192.168.1.0/24 target=192.168.1.0/24
HTB (Hierarchical Token Bucket) /CBQ (Class-Based Queuing)HTB Diagram:
/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=Linux-1_Con src
address=192.168.1.10
add action=mark-packet chain=forward connection-mark=Linux-1_Con new-packet-mark=
add action=mark-connection chain=prerouting new-connection-mark=Linux-2_Con src
address=192.168.1.11
add action=mark-packet chain=forward connection-mark=Linux-2_Con new-packet-mark=
/queue tree
add max-limit=256k name=Main-UL parent=ether1 queue=default
add limit-at=64k max-limit=256k name=Inner1-UL parent=Main-UL queue=default
add limit-at=64k max-limit=256k name=Leaf1-UL packet-mark=Linux-1 parent=Main-UL p
queue=default
add limit-at=32k max-limit=256k name=Leaf2-UL packet-mark=Linux-2 parent=Inner1-UL
add max-limit=256k name=Main-DL parent=ether2 queue=default
add limit-at=64k max-limit=256k name=Inner1-DL parent=Main-DL queue=default
add limit-at=64k max-limit=256k name=Leaf1-DL packet-mark=Linux-1 parent=Main-DL p
queue=default
add action=mark-connection chain=prerouting new-connection-mark=Linux-1_Con src
address=192.168.1.10
add action=mark-packet chain=forward connection-mark=Linux-1_Con new-packet-mark=
add action=mark-connection chain=prerouting new-connection-mark=Linux-2_Con src
address=192.168.1.11
add action=mark-packet chain=forward connection-mark=Linux-2_Con new-packet-mark=
/queue tree
add max-limit=256k name=Main-UL parent=ether1 queue=default
add limit-at=64k max-limit=256k name=Inner1-UL parent=Main-UL queue=default
add limit-at=64k max-limit=256k name=Leaf1-UL packet-mark=Linux-1 parent=Main-UL p
queue=default
add limit-at=32k max-limit=256k name=Leaf2-UL packet-mark=Linux-2 parent=Inner1-UL
add max-limit=256k name=Main-DL parent=ether2 queue=default
add limit-at=64k max-limit=256k name=Inner1-DL parent=Main-DL queue=default
add limit-at=64k max-limit=256k name=Leaf1-DL packet-mark=Linux-1 parent=Main-DL p
queue=default
add limit-at=32k max-limit=256k name=Leaf2-DL packet-mark=Linux-2 parent=Inner1-DL
PCQ (Per Connection Queue) Based Queues
/queue typeadd kind=pcq name=DL-128k pcq-classifier=dst-address
add kind=pcq name=UL-128k pcq-classifier=src-address
/queue simple
add name=Main target=""
add limit-at=256k/256k max-limit=512k/512k name=192.168.1.10 parent=Main target=192
add limit-at=256k/256k max-limit=512k/512k name=192.168.1.0/24 parent=Main queue=U
128k target=192.168.1.0/24
Bandwidth Control: Day night package
/queue simpleadd limit-at=64k/64k max-limit=128k/128k name=Day target=192.168.1.0/24
add limit-at=128k/128k max-limit=256k/256k name=Night target=192.168.1.0/24
/system script
add name=Day source="/queue simple enable Day; /queue simple disable Night"
add name=Night source=\"/queue simple enable Night; /queue simple disable Day"
/system scheduler
add interval=1d name=Day on-event=Day start-date=oct/14/2016 start-time=06:00:00
add interval=1d name=Night on-event=Night start-date=oct/14/2016 start-time=18:00:00
No comments:
Post a Comment