วันพฤหัสบดีที่ 17 เมษายน พ.ศ. 2557

Limit Download WAN RouterOS 5


จัดไปอีก V 5

/queue simple
add name="Wan1" interface=WAN1 max-limit=64M/8M priority=8 comment="Limit Download-Upload"
add name="Wan2" interface=WAN2 max-limit=16M/2M priority=8
add name="Wan3" interface=WAN3 max-limit=7M/512k priority=8
/

MIKROTIK 4 WAN PCC LOADBALANCE

#Simple Pcc Loadbalance 4Wan
#Rename ether as WAN1,WAN2,WAN3,WAN4,Local


/ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2
add address=192.168.3.2/24 network=192.168.3.0 broadcast=192.168.3.255 interface=WAN3
add address=192.168.4.2/24 network=192.168.4.0 broadcast=192.168.4.255 interface=WAN4

/ip firewall mangle
add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn
add chain=input in-interface=WAN3 action=mark-connection new-connection-mark=WAN3_conn
add chain=input in-interface=WAN4 action=mark-connection new-connection-mark=WAN4_conn

add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2
add chain=output connection-mark=WAN3_conn action=mark-routing new-routing-mark=to_WAN3
add chain=output connection-mark=WAN4_conn action=mark-routing new-routing-mark=to_WAN4

add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.3.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.4.0/24 action=accept in-interface=Local

add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/2 action=mark-connection new-connection-mark=WAN3_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:4/3 action=mark-connection new-connection-mark=WAN4_conn passthrough=yes

add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2
add chain=prerouting connection-mark=WAN3_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN3
add chain=prerouting connection-mark=WAN4_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN4

/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_WAN2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.3.1 routing-mark=to_WAN3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.4.1 routing-mark=to_WAN4 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.3.1 distance=3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.4.1 distance=4 check-gateway=ping

/ip firewall nat
add chain=srcnat src-address=192.168.0.0/24 out-interface=WAN1 action=masquerade
add chain=srcnat src-address=192.168.0.0/24 out-interface=WAN2 action=masquerade
add chain=srcnat src-address=192.168.0.0/24 out-interface=WAN3 action=masquerade
add chain=srcnat src-address=192.168.0.0/24 out-interface=WAN4 action=masquerade

/ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=5000KiB max-udp-packet-size=512 servers=8.8.8.8,4.2.2.6

/ip dns static
add address=192.168.0.1 disabled=yes name=dns ttl=1d
/ip pool
add name=dhcp_pool1 ranges=192.168.0.2-192.168.0.253

/ip dhcp-server
add address-pool=dhcp_pool1 authoritative=after-2sec-delay bootp-support=static disabled=no interface=ether2 lease-time=3d name=dhcp1
/ip dhcp-server config
set store-leases-disk=never

/ip dhcp-server network
add address=192.168.0.0/24 dhcp-option="" dns-server="" gateway=192.168.0.1 ntp-server="" wins-server=""

/system clock
set time-zone-name=manual

/system clock manual
set dst-delta=+00:00 dst-end="jan/01/1970 00:00:00" dst-start="jan/01/1970 00:00:00" time-zone=+07:00

/system ntp client
set enabled=yes mode=unicast primary-ntp=203.158.118.2 secondary-ntp=116.193.170.16

2 WAN UNEQUAL LOADBALANCE PCC FOR HOTSPOT


# change ether name as WAN1,WAN2,Local
# PCC Loadbalance for hotspot only.
# After Apply this script manually run hotspot setup
# Unequal Loadbalance for wan1
 
/ip pool add name=dhcp_pool1 ranges=192.168.21.2-192.168.21.254
 
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=Local name=dhcp1
 
/ip address
add address=192.168.1.2/24 interface=WAN1
add address=192.168.2.2/24 interface=WAN2
add address=192.168.21.1/24 interface=Local
 
/ip dhcp-server network
add address=192.168.21.0/24 gateway=192.168.21.1
 
/ip dns
set allow-remote-requests=yes cache-size=5000KiB max-udp-packet-size=2048 servers=8.8.8.8,8.8.4.4
 
/ip firewall mangle
add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn
add action=mark-routing chain=output connection-mark=WAN1_conn new-routing-mark=to_WAN1
add action=mark-routing chain=output connection-mark=WAN2_conn new-routing-mark=to_WAN2
add chain=prerouting dst-address=192.168.1.0/24 in-interface=Local
add chain=prerouting dst-address=192.168.2.0/24 in-interface=Local
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=auth in-interface=Local new-connection-mark=WAN1_conn per-connection-classifier=both-addresses-and-ports:3/0
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=auth in-interface=Local new-connection-mark=WAN2_conn per-connection-classifier=both-addresses-and-ports:3/1
add action=mark-connection chain=prerouting dst-address-type=!local hotspot=auth in-interface=Local new-connection-mark=WAN1_conn per-connection-classifier=both-addresses-and-ports:3/2
add action=mark-routing chain=prerouting connection-mark=WAN1_conn in-interface=Local new-routing-mark=to_WAN1
add action=mark-routing chain=prerouting connection-mark=WAN2_conn in-interface=Local new-routing-mark=to_WAN2
 
/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
 
/ip route
add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=to_WAN1
add check-gateway=ping distance=1 gateway=192.168.2.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.1.1
add check-gateway=ping distance=2 gateway=192.168.2.1

Limit Download File ใช้ได้เฉพาะ RouterOS 6.7 ขึ้นไป

Limit Download File ใช้ได้เฉพาะ RouterOS 6.7 ขึ้นไป


/ip firewall layer7-protocol add name="EXE" regexp="\\.(exe)"
/ip firewall layer7-protocol add name="RAR" regexp="\\.(rar)"
/ip firewall layer7-protocol add name="ZIP" regexp="\\.(zip)"
/ip firewall layer7-protocol add name="7z" regexp="\\.(7z)"
/ip firewall layer7-protocol add name="CAB" regexp="\\.(cab)"
/ip firewall layer7-protocol add name="ASF" regexp="\\.(asf)"
/ip firewall layer7-protocol add name="MOV" regexp="\\.(mov)"
/ip firewall layer7-protocol add name="WMV" regexp="\\.(wmv)"
/ip firewall layer7-protocol add name="MPG" regexp="\\.(mpg)"
/ip firewall layer7-protocol add name="MPEG" regexp="\\.(mpeg)"
/ip firewall layer7-protocol add name="MKV" regexp="\\.(mkv)"
/ip firewall layer7-protocol add name="AVI" regexp="\\.(avi)"
/ip firewall layer7-protocol add name="FLV" regexp="\\.(flv)"
/ip firewall layer7-protocol add name="WAV" regexp="\\.(wav)"
/ip firewall layer7-protocol add name="RM" regexp="\\.(rm)"
/ip firewall layer7-protocol add name="MP3" regexp="\\.(mp3)"
/ip firewall layer7-protocol add name="MP4" regexp="\\.(mp4)"
/ip firewall layer7-protocol add name="RAM" regexp="\\.(ram)"
/ip firewall layer7-protocol add name="RMVB" regexp="\\.(rmvb)"
/ip firewall layer7-protocol add name="DAT" regexp="\\.(dat)"
/ip firewall layer7-protocol add name="DAA" regexp="\\.(daa)"
/ip firewall layer7-protocol add name="ISO" regexp="\\.(iso)"
/ip firewall layer7-protocol add name="NRG" regexp="\\.(nrg)"
/ip firewall layer7-protocol add name="BIN" regexp="\\.(bin)"
/ip firewall layer7-protocol add name="VCD" regexp="\\.(vcd)"
/ip firewall layer7-protocol add name="3GP" regexp="\\.(3gp)"
/ip firewall layer7-protocol add name="AAC" regexp="\\.(aac)"
/ip firewall layer7-protocol add name="ACE" regexp="\\.(ace)"
/ip firewall layer7-protocol add name="AIF" regexp="\\.(aif)"
/ip firewall layer7-protocol add name="ARJ" regexp="\\.(arj)"
/ip firewall layer7-protocol add name="BZ2" regexp="\\.(bz2)"
/ip firewall layer7-protocol add name="GZ" regexp="\\.(gz)"
/ip firewall layer7-protocol add name="GZIP" regexp="\\.(gzip)"
/ip firewall layer7-protocol add name="IMG" regexp="\\.(img)"
/ip firewall layer7-protocol add name="LZH" regexp="\\.(lzh)"
/ip firewall layer7-protocol add name="M4A" regexp="\\.(m4a)"
/ip firewall layer7-protocol add name="M4V" regexp="\\.(m4v)"
/ip firewall layer7-protocol add name="MPA" regexp="\\.(mpa)"
/ip firewall layer7-protocol add name="MPE" regexp="\\.(mpe)"
/ip firewall layer7-protocol add name="MSI" regexp="\\.(msi)"
/ip firewall layer7-protocol add name="MSU" regexp="\\.(msu)"
/ip firewall layer7-protocol add name="OGG" regexp="\\.(ogg)"
/ip firewall layer7-protocol add name="OGV" regexp="\\.(ogv)"
/ip firewall layer7-protocol add name="PDF" regexp="\\.(pdf)"
/ip firewall layer7-protocol add name="PLJ" regexp="\\.(plj)"
/ip firewall layer7-protocol add name="PPS" regexp="\\.(pps)"
/ip firewall layer7-protocol add name="PPT" regexp="\\.(ppt)"
/ip firewall layer7-protocol add name="QT" regexp="\\.(qt)"
/ip firewall layer7-protocol add name="R0*" regexp="\\.(ro*)"
/ip firewall layer7-protocol add name="R1*" regexp="\\.(r1*)"
/ip firewall layer7-protocol add name="RA" regexp="\\.(ra)"
/ip firewall layer7-protocol add name="RM" regexp="\\.(rm)"
/ip firewall layer7-protocol add name="RMVB" regexp="\\.(rmvb)"
/ip firewall layer7-protocol add name="SEA" regexp="\\.(sea)"
/ip firewall layer7-protocol add name="SIT" regexp="\\.(sit)"
/ip firewall layer7-protocol add name="SITX" regexp="\\.(sitx)"
/ip firewall layer7-protocol add name="TAR" regexp="\\.(tar)"
/ip firewall layer7-protocol add name="TIF" regexp="\\.(tif)"
/ip firewall layer7-protocol add name="TIFF" regexp="\\.(tiff)"
/ip firewall layer7-protocol add name="WAV" regexp="\\.(wav)"
/ip firewall layer7-protocol add name="WMA" regexp="\\.(wma)"
/ip firewall layer7-protocol add name="Z" regexp="\\.(z)"
/ip firewall layer7-protocol add name="001" regexp="\\.(001)"
/ip firewall layer7-protocol add name="002" regexp="\\.(002)"
/ip firewall layer7-protocol add name="003" regexp="\\.(003)"
/ip firewall layer7-protocol add name="004" regexp="\\.(004)"
/ip firewall layer7-protocol add name="005" regexp="\\.(005)"
/
/ip firewall mangle add action=mark-packet chain=prerouting comment="EXE MARK PACKET" layer7-protocol=EXE new-packet-mark=EXE passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="RAR MARK PACKET" layer7-protocol=RAR new-packet-mark=RAR passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="ZIP MARK PACKET" layer7-protocol=ZIP new-packet-mark=ZIP passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="7z MARK PACKET" layer7-protocol=7z new-packet-mark=7z passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="CAB MARK PACKET" layer7-protocol=CAB new-packet-mark=CAB passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="ASF MARK PACKET" layer7-protocol=ASF new-packet-mark=ASF passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MOV MARK PACKET" layer7-protocol=MOV new-packet-mark=MOV passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="WMV MARK PACKET" layer7-protocol=WMV new-packet-mark=WMV passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MPG MARK PACKET" layer7-protocol=MPG new-packet-mark=MPG passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MPEG MARK PACKET" layer7-protocol=MPEG new-packet-mark=MPEG passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MKV MARK PACKET" layer7-protocol=MKV new-packet-mark=MKV passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="AVI MARK PACKET" layer7-protocol=AVI new-packet-mark=AVI passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="FLV MARK PACKET" layer7-protocol=FLV new-packet-mark=FLV passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="WAV MARK PACKET" layer7-protocol=WAV new-packet-mark=WAV passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="RM MARK PACKET" layer7-protocol=RM new-packet-mark=RM passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MP3 MARK PACKET" layer7-protocol=MP3 new-packet-mark=MP3 passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MP4 MARK PACKET" layer7-protocol=MP4 new-packet-mark=MP4 passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="RAM MARK PACKET" layer7-protocol=RAM new-packet-mark=RAM passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="RMVB MARK PACKET" layer7-protocol=RMVB new-packet-mark=RMVB passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="DAT MARK PACKET" layer7-protocol=DAT new-packet-mark=DAT passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="DAA MARK PACKET" layer7-protocol=DAA new-packet-mark=DAA passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="ISO MARK PACKET" layer7-protocol=ISO new-packet-mark=ISO passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="NRG MARK PACKET" layer7-protocol=NRG new-packet-mark=NRG passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="BIN MARK PACKET" layer7-protocol=BIN new-packet-mark=BIN passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="VCD MARK PACKET" layer7-protocol=VCD new-packet-mark=VCD passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="3GP MARK PACKET" layer7-protocol=3GP new-packet-mark=3GP passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="AAC MARK PACKET" layer7-protocol=AAC new-packet-mark=AAC passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="ACE MARK PACKET" layer7-protocol=ACE new-packet-mark=ACE passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="AIF MARK PACKET" layer7-protocol=AIF new-packet-mark=AIF passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="ARJ MARK PACKET" layer7-protocol=ARJ new-packet-mark=ARJ passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="BZ2 MARK PACKET" layer7-protocol=BZ2 new-packet-mark=BZ2 passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="GZ MARK PACKET" layer7-protocol=GZ new-packet-mark=GZ passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="GZIP MARK PACKET" layer7-protocol=GZIP new-packet-mark=GZIP passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="IMG MARK PACKET" layer7-protocol=IMG new-packet-mark=IMG passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="LZH MARK PACKET" layer7-protocol=LZH new-packet-mark=LZH passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="M4A MARK PACKET" layer7-protocol=M4A new-packet-mark=M4A passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="M4V MARK PACKET" layer7-protocol=M4V new-packet-mark=M4V passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MPA MARK PACKET" layer7-protocol=MPA new-packet-mark=MPA passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MPE MARK PACKET" layer7-protocol=MPE new-packet-mark=MPE passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MSI MARK PACKET" layer7-protocol=MSI new-packet-mark=MSI passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="MSU MARK PACKET" layer7-protocol=MSU new-packet-mark=MSU passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="OGG MARK PACKET" layer7-protocol=OGG new-packet-mark=OGG passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="OGV MARK PACKET" layer7-protocol=OGV new-packet-mark=OGV passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="PDF MARK PACKET" layer7-protocol=PDF new-packet-mark=PDF passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="PLJ MARK PACKET" layer7-protocol=PLJ new-packet-mark=PLJ passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="PPS MARK PACKET" layer7-protocol=PPS new-packet-mark=PPS passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="PPT MARK PACKET" layer7-protocol=PPT new-packet-mark=PPT passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="QT MARK PACKET" layer7-protocol=QT new-packet-mark=QT passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="R0* MARK PACKET" layer7-protocol=R0* new-packet-mark=R0* passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="R1* MARK PACKET" layer7-protocol=R1* new-packet-mark=R1* passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="RA MARK PACKET" layer7-protocol=RA new-packet-mark=RA passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="RM MARK PACKET" layer7-protocol=RM new-packet-mark=RM passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="RMVB MARK PACKET" layer7-protocol=RMVB new-packet-mark=RMVB passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="SEA MARK PACKET" layer7-protocol=SEA new-packet-mark=SEA passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="SIT MARK PACKET" layer7-protocol=SIT new-packet-mark=SIT passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="SITX MARK PACKET" layer7-protocol=SITX new-packet-mark=SITX passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="TAR MARK PACKET" layer7-protocol=TAR new-packet-mark=TAR passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="TIF MARK PACKET" layer7-protocol=TIF new-packet-mark=TIF passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="TIFF MARK PACKET" layer7-protocol=TIFF new-packet-mark=TIFF passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="WAV MARK PACKET" layer7-protocol=WAV new-packet-mark=WAV passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="WMA MARK PACKET" layer7-protocol=WMA new-packet-mark=WMA passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="Z MARK PACKET" layer7-protocol=Z new-packet-mark=Z passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="001 MARK PACKET" layer7-protocol=001 new-packet-mark=001 passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="002 MARK PACKET" layer7-protocol=002 new-packet-mark=002 passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="003 MARK PACKET" layer7-protocol=003 new-packet-mark=003 passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="004 MARK PACKET" layer7-protocol=004 new-packet-mark=004 passthrough=no
/ip firewall mangle add action=mark-packet chain=prerouting comment="005 MARK PACKET" layer7-protocol=005 new-packet-mark=005 passthrough=no
/
/queue tree add name="LIMIT FILE EXTENTION" parent=global priority=7 max-limit=50M  comment="Limit Download File"
/queue tree add name="7z" parent="LIMIT FILE EXTENTION" packet-mark=7z  queue=default priority=1 max-limit=20M
/queue tree add name="ASF" parent="LIMIT FILE EXTENTION" packet-mark=ASF  queue=default priority=1 max-limit=20M
/queue tree add name="AVI" parent="LIMIT FILE EXTENTION" packet-mark=AVI  queue=default priority=1 max-limit=20M
/queue tree add name="BIN" parent="LIMIT FILE EXTENTION" packet-mark=BIN  queue=default priority=1 max-limit=20M
/queue tree add name="CAB" parent="LIMIT FILE EXTENTION" packet-mark=CAB  queue=default priority=1 max-limit=20M
/queue tree add name="DAA" parent="LIMIT FILE EXTENTION" packet-mark=DAA  queue=default priority=1 max-limit=20M
/queue tree add name="DAT" parent="LIMIT FILE EXTENTION" packet-mark=DAT  queue=default priority=1 max-limit=20M
/queue tree add name="EXE" parent="LIMIT FILE EXTENTION" packet-mark=EXE  queue=default priority=1 max-limit=50M
/queue tree add name="FLV" parent="LIMIT FILE EXTENTION" packet-mark=FLV  queue=default priority=1 max-limit=20M
/queue tree add name="ISO" parent="LIMIT FILE EXTENTION" packet-mark=ISO  queue=default priority=1 max-limit=20M
/queue tree add name="MKV" parent="LIMIT FILE EXTENTION" packet-mark=MKV  queue=default priority=1 max-limit=20M
/queue tree add name="MOV" parent="LIMIT FILE EXTENTION" packet-mark=MOV  queue=default priority=1 max-limit=20M
/queue tree add name="MP3" parent="LIMIT FILE EXTENTION" packet-mark=MP3  queue=default priority=1 max-limit=20M
/queue tree add name="MP4" parent="LIMIT FILE EXTENTION" packet-mark=MP4  queue=default priority=1 max-limit=20M
/queue tree add name="MPEG" parent="LIMIT FILE EXTENTION" packet-mark=MPEG  queue=default priority=1 max-limit=20M
/queue tree add name="MPG" parent="LIMIT FILE EXTENTION" packet-mark=MPG  queue=default priority=1 max-limit=20M
/queue tree add name="NRG" parent="LIMIT FILE EXTENTION" packet-mark=NRG  queue=default priority=1 max-limit=20M
/queue tree add name="RAM" parent="LIMIT FILE EXTENTION" packet-mark=RAM  queue=default priority=1 max-limit=20M
/queue tree add name="RAR" parent="LIMIT FILE EXTENTION" packet-mark=RAR  queue=default priority=1 max-limit=50M
/queue tree add name="RM" parent="LIMIT FILE EXTENTION" packet-mark=RM  queue=default priority=1 max-limit=20M
/queue tree add name="RMVB" parent="LIMIT FILE EXTENTION" packet-mark=RMVB  queue=default priority=1 max-limit=20M
/queue tree add name="VCD" parent="LIMIT FILE EXTENTION" packet-mark=VCD  queue=default priority=1 max-limit=20M
/queue tree add name="WAV" parent="LIMIT FILE EXTENTION" packet-mark=WAV  queue=default priority=1 max-limit=20M
/queue tree add name="WMV" parent="LIMIT FILE EXTENTION" packet-mark=WMV  queue=default priority=1 max-limit=20M
/queue tree add name="ZIP" parent="LIMIT FILE EXTENTION" packet-mark=ZIP  queue=default priority=1 max-limit=50M
/queue tree add name="3GP" parent="LIMIT FILE EXTENTION" packet-mark=3GP  queue=default priority=1 max-limit=20M
/queue tree add name="AAC" parent="LIMIT FILE EXTENTION" packet-mark=AAC  queue=default priority=1 max-limit=20M
/queue tree add name="ACE" parent="LIMIT FILE EXTENTION" packet-mark=ACE  queue=default priority=1 max-limit=20M
/queue tree add name="AIF" parent="LIMIT FILE EXTENTION" packet-mark=AIF  queue=default priority=1 max-limit=20M
/queue tree add name="ARJ" parent="LIMIT FILE EXTENTION" packet-mark=ARJ  queue=default priority=1 max-limit=20M
/queue tree add name="BZ2" parent="LIMIT FILE EXTENTION" packet-mark=BZ2  queue=default priority=1 max-limit=20M
/queue tree add name="GZ" parent="LIMIT FILE EXTENTION" packet-mark=GZ  queue=default priority=1 max-limit=20M
/queue tree add name="GZIP" parent="LIMIT FILE EXTENTION" packet-mark=GZIP  queue=default priority=1 max-limit=20M
/queue tree add name="IMG" parent="LIMIT FILE EXTENTION" packet-mark=IMG  queue=default priority=1 max-limit=20M
/queue tree add name="LZH" parent="LIMIT FILE EXTENTION" packet-mark=LZH  queue=default priority=1 max-limit=20M
/queue tree add name="M4A" parent="LIMIT FILE EXTENTION" packet-mark=M4A  queue=default priority=1 max-limit=20M
/queue tree add name="M4V" parent="LIMIT FILE EXTENTION" packet-mark=M4V  queue=default priority=1 max-limit=20M
/queue tree add name="MPA" parent="LIMIT FILE EXTENTION" packet-mark=MPA  queue=default priority=1 max-limit=20M
/queue tree add name="MPE" parent="LIMIT FILE EXTENTION" packet-mark=MPE  queue=default priority=1 max-limit=20M
/queue tree add name="MSI" parent="LIMIT FILE EXTENTION" packet-mark=MSI  queue=default priority=1 max-limit=20M
/queue tree add name="MSU" parent="LIMIT FILE EXTENTION" packet-mark=MSU  queue=default priority=1 max-limit=20M
/queue tree add name="OGG" parent="LIMIT FILE EXTENTION" packet-mark=OGG  queue=default priority=1 max-limit=20M
/queue tree add name="OGV" parent="LIMIT FILE EXTENTION" packet-mark=OGV  queue=default priority=1 max-limit=20M
/queue tree add name="PDF" parent="LIMIT FILE EXTENTION" packet-mark=PDF  queue=default priority=1 max-limit=20M
/queue tree add name="PLJ" parent="LIMIT FILE EXTENTION" packet-mark=PLJ  queue=default priority=1 max-limit=20M
/queue tree add name="PPS" parent="LIMIT FILE EXTENTION" packet-mark=PPS  queue=default priority=1 max-limit=20M
/queue tree add name="PPT" parent="LIMIT FILE EXTENTION" packet-mark=PPT  queue=default priority=1 max-limit=20M
/queue tree add name="QT" parent="LIMIT FILE EXTENTION" packet-mark=QT  queue=default priority=1 max-limit=20M
/queue tree add name="R0*" parent="LIMIT FILE EXTENTION" packet-mark=R0*  queue=default priority=1 max-limit=20M
/queue tree add name="R1*" parent="LIMIT FILE EXTENTION" packet-mark=R1*  queue=default priority=1 max-limit=20M
/queue tree add name="RA" parent="LIMIT FILE EXTENTION" packet-mark=RA  queue=default priority=1 max-limit=20M
/queue tree add name="RM" parent="LIMIT FILE EXTENTION" packet-mark=RM  queue=default priority=1 max-limit=20M
/queue tree add name="RMVB" parent="LIMIT FILE EXTENTION" packet-mark=RMVB  queue=default priority=1 max-limit=20M
/queue tree add name="SEA" parent="LIMIT FILE EXTENTION" packet-mark=SEA  queue=default priority=1 max-limit=20M
/queue tree add name="SIT" parent="LIMIT FILE EXTENTION" packet-mark=SIT  queue=default priority=1 max-limit=20M
/queue tree add name="SITX" parent="LIMIT FILE EXTENTION" packet-mark=SITX  queue=default priority=1 max-limit=20M
/queue tree add name="TAR" parent="LIMIT FILE EXTENTION" packet-mark=TAR  queue=default priority=1 max-limit=20M
/queue tree add name="TIF" parent="LIMIT FILE EXTENTION" packet-mark=TIF  queue=default priority=1 max-limit=20M
/queue tree add name="TIFF" parent="LIMIT FILE EXTENTION" packet-mark=TIFF  queue=default priority=1 max-limit=20M
/queue tree add name="WAV" parent="LIMIT FILE EXTENTION" packet-mark=WAV  queue=default priority=1 max-limit=20M
/queue tree add name="WMA" parent="LIMIT FILE EXTENTION" packet-mark=WMA  queue=default priority=1 max-limit=20M
/queue tree add name="Z" parent="LIMIT FILE EXTENTION" packet-mark=Z  queue=default priority=1 max-limit=20M
/queue tree add name="001" parent="LIMIT FILE EXTENTION" packet-mark=001  queue=default priority=1 max-limit=20M
/queue tree add name="002" parent="LIMIT FILE EXTENTION" packet-mark=002  queue=default priority=1 max-limit=20M
/queue tree add name="003" parent="LIMIT FILE EXTENTION" packet-mark=003  queue=default priority=1 max-limit=20M
/queue tree add name="004" parent="LIMIT FILE EXTENTION" packet-mark=004  queue=default priority=1 max-limit=20M
/queue tree add name="005" parent="LIMIT FILE EXTENTION" packet-mark=005  queue=default priority=1 max-limit=20M
/