Mikrotik Speed Test Rules Configuration

 Mikrotik Ookla Speed Test Rules:

Hi Friends , Today we will configure Mikrotik for isp users they will provide extra speed on speed test.
When users download any file user gets their original data like 1Mb , 2Mb and when users do speed test they get extra bandwidth. we will configure Mikrotik for this scenario.

Scenario:

This Scenario may use Internet Service Provider , Office environment etc.

Hardware for this Project:

We will use Mikrotik Routerboard for this Project. I'm doing all task on Mikrotik Hap mini.

Mikrotik Configuration using Winbox:

Friends, We will Configure our Mikrotik for Speed test rules using Winbox. This is a GUI base tool.
Connect Mikrotik with Laptop / PC using CAT6 Patch cord. Just open Winbox and connect your Mikrotik with you laptop. 1st we will configure our Mikrotik as a simple router LAN , WAN as per your scenario, then we will make our speed test rules in firewall mangle.
We will done our setting in following steps.
  1. add address list of speedtest.net "Ookla" in mikrotik
  2. mark connection / mark packet in firewall mangle
  3. manage speed in queue
Lets Start.
    We will just copy and paste bellow script in terminal. This will add all ip address list of speedtest.net
/ip firewall address-list
add address=103.103.42.10 list="Speed Test Pk"
add address=103.11.0.11 list="Speed Test Pk"
add address=103.116.249.254 list="Speed Test Pk"
add address=103.116.250.222 list="Speed Test Pk"
add address=103.116.250.230 list="Speed Test Pk"
add address=103.137.69.2 list="Speed Test Pk"
add address=103.141.4.11 list="Speed Test Pk"
add address=103.144.11.254 list="Speed Test Pk"
add address=103.209.52.230 list="Speed Test Pk"
add address=103.221.246.178 list="Speed Test Pk"
add address=103.221.246.58 list="Speed Test Pk"
add address=103.24.96.54 list="Speed Test Pk"
add address=103.255.149.43 list="Speed Test Pk"
add address=103.70.251.246 list="Speed Test Pk"
add address=103.73.102.242 list="Speed Test Pk"
add address=103.8.112.178 list="Speed Test Pk"
add address=103.83.23.54 list="Speed Test Pk"
add address=103.83.89.16 list="Speed Test Pk"
add address=111.119.161.74 list="Speed Test Pk"
add address=115.167.73.248 list="Speed Test Pk"
add address=115.167.77.178 list="Speed Test Pk"
add address=115.186.89.34 list="Speed Test Pk"
add address=115.42.72.14 list="Speed Test Pk"
add address=115.42.74.14 list="Speed Test Pk"
add address=115.42.76.14 list="Speed Test Pk"
add address=119.153.112.82 list="Speed Test Pk"
add address=119.159.242.145 list="Speed Test Pk"
add address=119.30.107.214 list="Speed Test Pk"
add address=119.30.107.222 list="Speed Test Pk"
add address=119.73.65.24 list="Speed Test Pk"
add address=119.73.65.25 list="Speed Test Pk"
add address=119.73.65.26 list="Speed Test Pk"
add address=124.29.201.150 list="Speed Test Pk"
add address=124.29.242.206 list="Speed Test Pk"
add address=175.110.102.163 list="Speed Test Pk"
add address=180.178.172.210 list="Speed Test Pk"
add address=180.178.184.62 list="Speed Test Pk"
add address=182.176.14.38 list="Speed Test Pk"
add address=182.176.176.194 list="Speed Test Pk"
add address=202.142.160.20 list="Speed Test Pk"
add address=202.154.239.26 list="Speed Test Pk"
add address=202.166.166.18 list="Speed Test Pk"
add address=202.59.80.52 list="Speed Test Pk"
add address=202.69.11.13 list="Speed Test Pk"
add address=202.69.12.13 list="Speed Test Pk"
add address=202.69.44.88 list="Speed Test Pk"
add address=203.124.29.4 list="Speed Test Pk"
add address=203.124.30.130 list="Speed Test Pk"
add address=203.135.29.17 list="Speed Test Pk"
add address=203.80.128.27 list="Speed Test Pk"
add address=210.2.157.133 list="Speed Test Pk"
add address=27.255.28.140 list="Speed Test Pk"
add address=39.62.40.6 list="Speed Test Pk"
add address=39.62.44.10 list="Speed Test Pk"
add address=42.201.200.178 list="Speed Test Pk"
add address=45.249.11.16 list="Speed Test Pk"
add address=58.27.149.65 list="Speed Test Pk"
add address=58.65.177.234 list="Speed Test Pk"
add address=103.104.214.4 list="Speed Test Pk"
add address=103.152.43.122 list="Speed Test Pk"
add address=103.221.247.2 list="Speed Test Pk"
add address=103.221.247.4 list="Speed Test Pk"
add address=103.221.247.5 list="Speed Test Pk"
add address=103.221.247.6 list="Speed Test Pk"
add address=88.208.39.69 list="Speed Test Pk"
add address=210.197.74.203 list="Speed Test Pk"
add address=112.215.198.21 list="Speed Test Pk"
add address=168.235.80.32 list="Speed Test Pk"
add address=203.135.17.22 list="Speed Test Pk"
add address=103.221.247.3 list="Speed Test Pk"
add address=81.4.109.51 list="Speed Test Pk"
add address=144.160.149.203 list="Speed Test Pk"
add address=144.160.19.56 list="Speed Test Pk"
add address=103.152.43.254 list="Speed Test Pk"
Now we will mark connect & mark packets of this address list.

/ip firewall mangle	
add chain=forward src-address-list="Speed Test Pk" action=mark-connection new-connection-mark=SpeedTest_Conn passthrough=yes comment="SpeedTestServer"	
add chain=prerouting protocol=tcp src-port=8080 action=mark-connection new-connection-mark=SpeedTest_Conn passthrough=yes comment="SpeedTestServe"	
add chain=prerouting connection-mark=SpeedTest_Conn action=mark-packet new-packet-mark=SpeedTest_Packets passthrough=no comment="SpeedTestServer"
add chain=postrouting protocol=tcp dst-port=8080 action=mark-connection new-connection-mark=SpeedTest_Conn passthrough=yes comment="SpeedTestServer"
add chain=postrouting connection-mark=SpeedTest_Conn action=mark-packet new-packet-mark=SpeedTest_Packets passthrough=no comment="SpeedTestServer"
Now we will add PCQ rule in Queue. We make only 2 rules for download / upload. 
Then we will allow to the target address in simple queue
/queue type 
add name=5M-DownLoad kind=pcq pcq-rate=5M pcq-classifier=dst-address 
add name=5M-UpLoad kind=pcq pcq-rate=5M pcq-classifier=src-address
/queue simple
add name=5Mb-SpeedTest packet-marks=SpeedTest_Packets queue=5M-UpLoad/5M-DownLoad target=0.0.0.0/0

Testing:

we can test our result on Laptop / PC / Mobile. If our Client profile set on 2Mbps now the client gets 5Mbps only when the user do SpeedTest.
Hope you like my effort

Why not a Cup of COFFEE if you like my effort?

Post a Comment

0 Comments

About