Page 1 of 1

Priority to Port

Posted: Tue Dec 04, 2018 8:40 am
by Arxondas
Hello all,

I need your help about a mangle rule.
I have a Server with mysql behide a mikrotik router. I want to give priority
to the mysql port (3306/tcp) over everything else for so mysql Server will always have best traffic from & to internet.

my mangle rules are :
/ip firewall mangle add action=mark-connection chain=forward disabled=no in-interace=wan1 new-connection-mark=server.upload passthrough=yes port=3306 protocol=tcp
/ip firewall mangle add action=mark-connection chain=forward disabled=no new-connection-mark=radius.downlad out-interface=wan1 passthrough=yes port=3306 protocol=tcp
/ip firewall mangle add action=mark-packet chain=forward connection-mark=server.upload disabled=no new-paket-mark=server.upload passthrough=yes
/ip firewall mangle add action=mark-packet chain=forward connection-mark=server.download disabled=no new-packet-mark=server.download passthrough=yes

then in queue tree I setup highest priority for this packets along with other rules with low priority.

Is that OK or I need to do something different.

Thank you.

Re: Priority to Port

Posted: Tue Dec 04, 2018 8:43 am
by mkx
There's nothing you can do to increase priority in DL direction ... that's up to your ISP to arrange. You can, though, increase priority in UL. For that, wan1 will be out-interface.

Re: Priority to Port

Posted: Tue Dec 04, 2018 8:52 am
by Arxondas
Hello,

Thx for your replay. Because mikrotik gives internet to other devices also except of the Server
I want when I connect to mysql from outside to have priority to traffic if my bandwidth is full because
some clients e.g. download something. Same for upload when the Server needs to answer to an external
client.

thanks

Re: Priority to Port

Posted: Tue Dec 04, 2018 9:56 am
by sebastia
There's nothing you can do to increase priority in DL direction ... that's up to your ISP to arrange. You can, though, increase priority in UL. For that, wan1 will be out-interface.
From my experience, that's is not entirely true. Since most of the traffic on net is tcp based, one can limit the throughput of data coming from ISP and making sure QoS is ensured. To limit tcp connections, it suffices to drop when necessary some packets, which will result in:
* retransmission
* reduction of transmission speed (reduction of window) by sender

This can be achieved by attaching a queue to interface connected to lan. The approach is further similar to upload side.