Sending a VLAN via a specific gw - is this right?

Hi,

We have a RB3011UiAS-RM router, and we use multiple VLANs and we have multiple internet connections to use. What we are trying to do now is to send the traffic from one of the VLANs via one of the internet connections and the rest of the traffic via the other connection, but they should fall back to the other connection.

I have read and watched many guides, there seem to be many approaches for this, and I know that the wrong config can cause a serious performance issue. So I’m wondering if the way I set it up is the right way or if I made a mistake.

Basically what I did is to connect the two WANs on the first two ports, let’s say the second WAN’s gateway is 192.168.0.1, and added the following config:

/ip firewall mangle
add action=mark-routing chain=prerouting in-interface=vlan10 new-routing-mark=routing-wan2 passthrough=yes
/ip route
add check-gateway=ping comment=routing-wan2 distance=1 gateway=192.168.0.1 routing-mark=routing-wan2

Aand that’s it. It’s fairly simple and does work for sure, just really not sure if this is how it should be done. Any advice would be appreciated.

Thanks!