Saturday, May 28, 2016

Allowing Specific Ports High Priority over other traffic by simple queue

First we need to mark protocols. In this example we are using SMTP port 25 to provide high priority.

here,
interface=ether1 is your WAN interface.


/ip firewall mangle add chain=prerouting protocol=tcp port=25 connection-state=new action=mark-connection new-connection-mark=smtp(port25)_connection_mark_high_prio comment="smtp(port25)_connection_mark_high_prio"

/ip firewall mangle add chain=prerouting connection-mark=smtp(port25)_connection_mark_high_prio action=mark-packet new-packet-mark=smtp(port25)_packet_mark_high_prio comment="smtp(port25)_packet_mark_high_prio"


Now we will create Simple Queue and give high priority to marked packets and other packets low priority. (In this example we have 2Mb WAN connection)


/queue simple add name=wan_total_conn_limit interface=ether1 max-limit=2M/2M
/queue simple add name=high_prio_smtp(port25) interface=ether1 parent=wan_total_conn_limit packet-marks=smtp(port25)_packet_mark_high_prio priority=1
/queue simple add name=other_prio_low interface=ether1 parent=Internet priority=8


Now SMTP traffic will get higher priority over other traffic.

1 comment:

  1. error? parent=Internet or parent=wan_total_conn_limit interface

    ReplyDelete