Prioritise traffic from a destination address

Hi,

I want to priorities traffic from a destination address (VOIP Server) but I am stuggling to workout how to do this. I understand that I have to mark the traffic from the destination and then create a queue but I am not sure of the syntax.

This is also going through an MT loadbalancer so I also need to force the traffic down one connection.

Can anyone help please.


THanks

this might help :slight_smile:
http://forum.mikrotik.com/t/burst-for-each-tcp-connection/10713/1

Hi Janisk

I have setup the mangle rules to mark the connection and packets, this seems to be woring fine. My problem is with the queues. Please see config below. I have disabled them at the moment because I was not seeing any traffic on the all_traffic queue. I would also like to route all voip traffic through WAN1 as well.

Mangle

0 ;;; P2P Mangle rule
chain=prerouting p2p=all-p2p action=mark-connection new-connection-mark=p2p_connection passthrough=yes

1 ;;; Marks to packet before the firewall rule drops the packet
chain=prerouting connection-mark=p2p_connection action=mark-packet new-packet-mark=p2p_packet
passthrough=yes

2 X ;;; voip mangle rule Marks connection
chain=prerouting dst-address=212.23.56.228 action=mark-connection new-connection-mark=voip
passthrough=yes

3 X ;;; Marks all other traffic before passing to the queue. Traffic priority + 8 which is the lowest
chain=prerouting action=mark-connection new-connection-mark=all_traffic passthrough=yes

4 X chain=prerouting action=mark-packet new-packet-mark=all_traffic passthrough=yes

5 X chain=prerouting dst-address=212.23.56.246 action=mark-connection new-connection-mark=voip
passthrough=yes

6 X chain=prerouting action=mark-packet new-packet-mark=voip passthrough=yes

7 X chain=prerouting dst-address=212.23.56.248 action=mark-connection new-connection-mark=voip
passthrough=yes

8 X chain=prerouting src-address=172.22.1.200 action=mark-connection new-connection-mark=voip
passthrough=yes

9 X chain=postrouting out-interface=WAN1 packet-mark=voip action=passthrough


queues:

Simple queue
0 X name=“Main” dst-address=0.0.0.0/0 interface=all parent=none direction=both priority=8
queue=ethernet-default/ethernet-default limit-at=0/0 max-limit=0/0 total-queue=default-small


Tree queue
0 X name=“queue1” parent=main packet-mark=voip limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s

1 X name=“queue2” parent=main packet-mark=all_traffic limit-at=0 queue=default priority=3 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s

2 X name=“main” parent=global-total packet-mark=“” limit-at=0 queue=default priority=8 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s

Re-arrange your mangle rules as follows:

0 ;;; P2P Mangle rule
chain=prerouting p2p=all-p2p action=mark-connection new-connection-mark=p2p_connection passthrough=yes

1 ;;; Marks to packet before the firewall rule drops the packet
chain=prerouting connection-mark=p2p_connection action=mark-packet new-packet-mark=p2p_packet
passthrough=no

2 ;;; voip mangle rule Marks connection
chain=prerouting dst-address=212.23.56.228 action=mark-connection new-connection-mark=voip
passthrough=yes

3 chain=prerouting dst-address=212.23.56.246 action=mark-connection new-connection-mark=voip
passthrough=yes

4 chain=prerouting dst-address=212.23.56.248 action=mark-connection new-connection-mark=voip
passthrough=yes

5 chain=prerouting src-address=172.22.1.200 action=mark-connection new-connection-mark=voip
passthrough=yes

6 X chain=prerouting action=mark-packet new-packet-mark=voip passthrough=no

7 ;;; Marks all other traffic before passing to the queue. Traffic priority + 8 which is the lowest
chain=prerouting action=mark-connection new-connection-mark=all_traffic passthrough=yes


8 chain=prerouting action=mark-packet new-packet-mark=all_traffic passthrough=no


9 chain=postrouting out-interface=WAN1 packet-mark=voip action=passthrough

Note that passthrough in 1, 6 and 8 is “no”

What do I do about the queues and the priority of VOIP ?


Thanks Mark

Hi skillful

I have setup the mangle as you explained but I am not seeing any traffic on the all_traffic rule. I need to mark all other traffic so that I can priorites in the queues …


Thanks Mark

I suggest you add “in-interface” to the “all_traffic” rule mangle rule, i.e

7 ;;; Marks all other traffic before passing to the queue. Traffic priority + 8 which is the lowest
chain=prerouting in-interface=lan action=mark-connection new-connection-mark=all_traffic passthrough=yes

where “lan” is the interface name

Skillful,

Thanks for that. I am still not seeing any traffic on the all_traffic queue ??

:frowning:


Seem strange

Mark

Can you see any traffic in the “all_traffic” mangle rule?

Skillful,

Yeah I can see traffic in the mangle rule but not in the queue?

Thanks Mark

Export your queue rule and post it here

Skillful,

It at the top of the topic.


Thanks Mark

They are disabled!

Skillful,


Thats because they are not working. I am not sure they are setup correctly.

Mark

They appear okay. Leave the simple queue rule disabled but enable the tree queues and see what happens.

Do you have infinite bandwidth? If not, you might have to specify a value for max-limit for things to work properly.