VOIP QOS Issue

I am running the latest stable RouterOS and I’m having some issues getting QOS to work properly. I am mangling the packets and I can see that the VOIP is getting detected but the other mangle rule for all traffic doesn’t seem to catch anything. I’ve google different ways to do this to death and at this point I am stumped. Here are my rules.

/ip firewall mangle
add action=mark-connection chain=forward new-connection-mark=VOIP protocol=\
    udp src-address=192.168.5.40
add action=mark-packet chain=forward connection-mark=VOIP new-packet-mark=\
    VOIP passthrough=no
add action=mark-connection chain=forward dst-address=192.168.5.40 \
    new-connection-mark=VOIP protocol=udp
add action=mark-packet chain=forward connection-mark=VOIP new-packet-mark=\
    VOIP
add action=mark-connection chain=forward connection-mark=no-mark \
    new-connection-mark=OTHER
add action=mark-packet chain=forward connection-mark=OTHER new-packet-mark=\
    OTHER passthrough=no

/queue tree
add name=LEVEL_A_UP parent=ether1-gateway queue=default
add name=LEVEL_A_DOWN parent=ether2-master-local queue=default
add max-limit=18M name=LEVEL_B_UP parent=ether1-gateway queue=default
add max-limit=218M name=LEVEL_B_DOWN parent=ether2-master-local queue=default
add name=VOIP_U packet-mark=VOIP parent=LEVEL_A_UP priority=1 queue=default
add name=VOIP_D packet-mark=VOIP parent=LEVEL_A_DOWN priority=1 queue=default
add name=OTHER_U packet-mark=OTHER parent=LEVEL_B_UP priority=2 queue=default
add name=OTHER_D packet-mark=OTHER parent=LEVEL_B_DOWN priority=2 queue=\
    default

Basically I am limiting the total bandwidth slightly to give 5mb to the phone system.

Any help or suggestions are greatly appreciated.

Thanks.

Use the prerouting chain instead of the forward chain.
It seems like forward should work, but I’ve had strange things like yours just work better when using prerouting.

Your rules look like they would work.

You might try it like this if switching them to prerouting doesn’t work:

/ip firewall mangle
add chain=prerouting connection-mark=no-mark action=jump jump-target=classify
add chain=prerouting connection-mark=VOIP action=mark-packet new-packet-mark=VOIP passthrough=no
add chain=prerouting action=mark-packet new-packet-mark=OTHER passthrough=no

add chain=classify action=mark-connection new-connection-mark=VOIP protocol=udp src-address=192.168.5.40
add chain=classify connection-mark=no-mark action=mark-connection new-connection-mark=VOIP protocol=udp dst-address=192.168.5.40
add chain=classify connection-mark=no-mark action=mark-connection new-connection-mark=OTHER
add chain=classify action=return

Tried both of your suggestions to no avail. I’m not even sure that VOIP is being mangled at this point but some sort of traffic is going through the mangle rule because the counters are going up. I had this configuration working fine on the RB850Gx2. Now we have switched to the RB3011UiAS-RM and I can’t manage to get it to work to save my life. Any other suggestions?

For the fun of it I set a simple queue to limit 1M in both directions and even that won’t limit bandwidth on my connection. What am I missing here?

If you have a fasttrack-connection rule in your forward chain, try disabling that. It expedites the packets through the router without checking queues and so forth.

Nailed it that time. Disabled the rule and now my Queues are working. Will this impact anything else leaving this disabled?

Your maximum throughput is going to drop significantly with fasttrack disabled, as the CPU is going to get much more involved in the forwarding process, but that’s a sacrifice you have to make if you want to use queues. Just keep an eye on the CPU % and as long as it stays below 75% at your peak bandwidth, you should be okay.

Thanks for all the help, it is greatly appreciated.