How to prioritise traffics with Mikrotik.
One of the greatest challenges you can face as a network administrator is the problem of link congestion. When this happens, emails are stuck; uploading and downloading email attachments take forever! I dont know about you but as for me,one thing I dont like to do is spend my time waiting to have my mails downloaded or uploaded. If find yourself in this situation, worry no more! We are going to deploy our experience in quality of service (QoS) to solve this problem by prioritising our traffics.
To do this, we will be using mangle to mark our SMTP connections and packets, and then give the SMTP packets a priority of 0 in our queue tree. The lower the priority number, the better. So here we go!
First thing first, we mark our SMTP connections and Packets for our LAN. To accomplish this, copy these codes, edit where necessary, and paste the following into your Mikrotik new terminal window:
/ip firewall mangle add chain=forward protocol=tcp dst-port=25 passthrough=no action=mark-connection new-connection-mark=SMTP-connection
/ ip firewall mangle add chain=forward connection-mark=SMTP-connect action=mark-packet new-packet-mark=SMTP-packet
Our mangle rule, as can be seen highlighted above is already marking traffics as can be seen in the picture above.
Next we head to back to the new terminal window and paste the below codes.
/queue tree add name=SMTP-Queue parent=global packet-mark=SMTP-packet priority=1
Note that for this to work effectively, you have to mark other traffics and set up a queue for your total bandwidth, then this queue that we created whose parent queue will be the queue for total bandwidth, and then the queue for other traffic. The queue for total bandwidth should be left with the default priority value of eight, the queue for other traffics MUST not have a priority value lesser than that of the SMPT queue. The lesser the priority value the higher the priority for the queued packects.