How many connection marks and packet marks can be set at the same time

Hello.

I am confronted with the problem that 1 have a Mirktotik router with multiple WANs and the connection are marked with magle roules and the packetes get there routing mark.
Now QoS for VoIP should be implemented but it seams that I need to set Connection marks for this (https://mum.mikrotik.com/presentations/NL19/presentation_6713_1556529224.pdf),
Now my question how can I mark the connections for the Routing and the QoS?
If I have a connection marked for WAN2 (incoming connection) and replace it with the connection mark to VoIP, I lose my routing.
Is it Possible to set more than one connection mark?

Only one connection mark can be assigned to a connection at a time…
Routing and the QoS is still possible.
Look up : http://forum.mikrotik.com/t/multiple-connection-marks/54806/1

After reading the forum article I am a bit confused.
Caci99 wrote that the traffic should first marked for QoS an than for routing, but i can only find the Interfaces an a global queue.
global-in and global-out are not shown in 6.49 and both WANs have different bandwidth so I must somehow adjust the limits so it works in a fail-over situation.

The example from sindy says, that it is necessary to used combined connection marks and is relay complex to handle even with only 2 routes and 3 QoS-rules.
So with 2 WANs and at least three internal networks (one for telephones and telephone system, one for normal web traffic and telephone soft client, and the third for network managing)
it seams to be painful to manage.(Third ISP for redundancy over LTE is in planing).

Is there a way to use the DSCP(TOS) value directly for QoS or is the only option to use the connection and packet marking?

I always use DSCP for QoS, that is certainly possible. Use a mangle rule like this:

/ip firewall mangle
add action=set-priority chain=postrouting comment="From dscp high 3 bits" \
    new-priority=from-dscp-high-3-bits passthrough=yes

Unfortunately when you want to use that with “/queue tree” you need to set packet marks for that. It should be possible to match queue tree items to priority levels, but it isn’t. You would need extra rules in addition to the above, like:

add action=mark-packet chain=postrouting comment="Priority 0" \
    new-packet-mark=prio0 passthrough=yes priority=0
add action=mark-packet chain=postrouting comment="Priority 1" \
    new-packet-mark=prio1 passthrough=yes priority=1
add action=mark-packet chain=postrouting comment="Priority 2" \
    new-packet-mark=prio2 passthrough=yes priority=2
add action=mark-packet chain=postrouting comment="Priority 3" \
    new-packet-mark=prio3 passthrough=yes priority=3
add action=mark-packet chain=postrouting comment="Priority 4" \
    new-packet-mark=prio4 passthrough=yes priority=4
add action=mark-packet chain=postrouting comment="Priority 5" \
    new-packet-mark=prio5 passthrough=yes priority=5
add action=mark-packet chain=postrouting comment="Priority 6" \
    new-packet-mark=prio6 passthrough=yes priority=6
add action=mark-packet chain=postrouting comment="Priority 7" \
    new-packet-mark=prio7 passthrough=yes priority=7

That is a pity because it “wastes” the packet marks which you might want to use for something else.
Technically it would be possible (in Linux) to set up to 32 packet marks on a single packet, but RouterOS does not support it.

In a similar situation as yours I have 2 different queue trees for upload to each ISP with packet marks like the above, and for queue trees towards the several local networks I use the global queue tree. I mark incoming traffic from the ISP interfaces each with 8 more packet marks (isp1-prio0..isp1-prio7 and isp2-prio0..isp2-prio7).
Ugly, but at the moment it seems the only possibility.

Hopefully at some time MikroTik add direct matching of priority in a queue tree (should be easy) and also multiple packet marks (will probably be more difficult to do in a backward-compatible way, but we have seen other changes with similar impact in version 7 so maybe there is hope)