Friday, November 14, 2014

Separate and Prioritize Browsing on the Mikrotik






Perhaps you have thought, If you give 128 kbps of the bandwidth, constraints limit was too small. But if give the bandwidth limit was raised as 256kbps, 512 kbps or greater, I was worried about going against with bandwidth monopoly when the client download is very much, it's possibility occurs bandwidth distribution inequality with some clients. the client when browsing will lose then downloader. I was thinking how to give same satisfaction for all of my clients.

So when the internet connection used with many clients the bandwidth still remains evenly distributed, which gives prioritize browsing speed against download speed, because download speed spend a lot of bandwidth for a long time.
Therefore this is essential problems for all of us. The logic is like this, the limit based on the file extension then we try to limit based by the file size.

For example, the file about to be downloaded >1MB (larger than 1 MB) then it would be categorized as Download and if <1MB (smaller than 1 MB) this is categorized as Browsing. The Confinguration is not limiting Bandwidth, but only just distinguish the priority. So if there is no client browsing the download will be fast again.
Ok I think is clear enough, and now how do we apply the browsing can be prioritize when many clients use our internet connection in mikrotik winbox.

Log in into your Winbox with a password that you have. If you not have yet, ask with your internet service provider (ISP). Look at the picture above! Go to the new terminal menu tab and right click and paste the script below at the cursor terminal command mikrotik.

/ip firewall mangle
add chain=prerouting action=mark-connection new-connection-mark=conn-download passthrough=yes protocol=tcp dst-port=80 connection-bytes=1000000-0 comment="CONN-DOWNLOAD"
add chain=prerouting action=mark-packet new-packet-mark=download-packet passthrough=no connection-mark=conn-download
add chain=prerouting action=mark-connection new-connection-mark=conn-browsing passthrough=yes protocol=tcp dst-port=80 connection-bytes=0-1000000 comment="CONN-BROWSING"
add chain=prerouting action=mark-packet new-packet-mark=browsing-packet passthrough=no connection-mark=conn-browsing

After insert the script for separation between download and browsing, you will see like the picture above. Then you can check the results by click on IP> Firewall> Mangle, look at the right picture above.
The second is create queue tree and you just need to insert the second script below.
/queue tree

add name="paket browsing" parent=global-in packet-mark=browsing-packet limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
add name="paket download" parent=global-in packet-mark=download-packet limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s 
Go to the new terminal menu tab again, right click and paste the second script  at the cursor terminal, will shown as the picture above. Check the results by click on Queues> Queue Tree.
It is easy - I hope can help you enforce justice against your client, good luck!

1 comments:

Andrew Stark said...

McAfee is a fantastic choice if you want antivirus software with real-time malware detection for all of your devices at a reasonable price. Most antivirus software, such as a firewall, Wi-Fi security, a password manager, and PC optimization, but mcafee.com/activate offers extras such as a file shredder, PC cleaner, identity protection, and a virtual private network.