Wednesday, November 2, 2016

Limit Bandwith using Layer 7-Protocol


SCRIPT I
/ip firewall layer7-protocol
add comment="" name=ISO regexp="\\.(iso)"
add comment="" name=NRG regexp="\\.(nrg)"
add comment="" name=RM regexp="\\.(rm)"
add comment="" name=RM1 regexp="\\.(rm1)"
add comment="" name=MP4 regexp="\\.(mp4)"
add comment="" name=AVI regexp="\\.(avi)"
add comment="" name=WAV regexp="\\.(wav)"
add comment="" name=MPG regexp="\\.(mpg)"
add comment="" name=MP3 regexp="\\.(mp3)"
add comment="" name=MPEG regexp="\\.(mpeg)"
add comment="" name=WMV regexp="\\.(wmv)"
add comment="" name=3GP regexp="\\.(3gp)"
add comment="" name=FLV regexp="\\.(flv)"
add comment="" name=MOV regexp="\\.(mov)"
add comment="" name=IMG regexp="\\.(img)"
add comment="" name=DOC regexp="\\.(doc)"
add comment="" name=PPT regexp="\\.(ppt)"
add comment="" name=PDF regexp="\\.(pdf)"
add comment="" name=EXE regexp="\\.(exe)"
add comment="" name=MSI regexp="\\.(msi)"
add comment="" name=7Z regexp="\\.(7z)"
add comment="" name=BIN regexp="\\.(bin)"
add comment="" name=GZ regexp="\\.(gz)"
add comment="" name=GZIP regexp="\\.(gzip)"
add comment="" name=TAR regexp="\\.(tar)"
add comment="" name=RAR regexp="\\.(rar)"
add comment="" name=ZIP regexp="\\.(zip)"

SCRIPT II
/ip firewall mangle
add action=mark-packet chain=forward comment="EKSTENSI-LAYER-7" disabled=no layer7-protocol=ISO new-packet-mark=ISO passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=NRG new-packet-mark=NRG passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=RM new-packet-mark=RM passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=RM1 new-packet-mark=RM1 passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=MP4 new-packet-mark=MP4 passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=AVI new-packet-mark=AVI passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=WAV new-packet-mark=WAV passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=MPG new-packet-mark=MPG passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=MP3 new-packet-mark=MP3 passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=MPEG new-packet-mark=MPEG passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=WMV new-packet-mark=WMV passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=3GP new-packet-mark=3GP passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=FLV new-packet-mark=FLV passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=MOV new-packet-mark=MOV passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=IMG new-packet-mark=IMG passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=DOC new-packet-mark=DOC passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=PPT new-packet-mark=PPT passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=PDF new-packet-mark=PDF passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=EXE new-packet-mark=EXE passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=MSI new-packet-mark=MSI passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=7Z new-packet-mark=7Z passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=BIN new-packet-mark=BIN passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=GZ new-packet-mark=GZ passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=GZIP new-packet-mark=GZIP passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=TAR new-packet-mark=TAR passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=RAR new-packet-mark=RAR passthrough=no
add action=mark-packet chain=forward comment="" disabled=no layer7-protocol=ZIP new-packet-mark=ZIP passthrough=no

SCRIPT III
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=256k max-limit=256k name=Limit-Download packet-mark=no-mark parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=ISO packet-mark=ISO parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=NRG packet-mark=NRG parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=RM packet-mark=RM parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=RM1 packet-mark=RM1 parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=MP4 packet-mark=MP4 parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=AVI packet-mark=AVI parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=WAV packet-mark=WAV parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=MPG packet-mark=MPG parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=MP3 packet-mark=MP3 parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=MPEG packet-mark=MPEG parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=WMV packet-mark=WMV parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=3GP packet-mark=3GP parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=FLV packet-mark=FLV parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=MOV packet-mark=MOV parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=IMG packet-mark=IMG parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=DOC packet-mark=DOC parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=PPT packet-mark=PPT parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=PDF packet-mark=PDF parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=EXE packet-mark=EXE parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=MSI packet-mark=MSI parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=7Z packet-mark=7Z parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=BIN packet-mark=BIN parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GZ packet-mark=GZ parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GZIP packet-mark=GZIP parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=TAR packet-mark=TAR parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=RAR packet-mark=RAR parent=Limit-Download priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=ZIP packet-mark=ZIP parent=Limit-Download priority=8 queue=default

No comments: