Forcing traffic through specific WAN

Hi everyone,

I have a specific range of ports I’d like to always go through WAN1 because it has a lower latency and it’s ideal for the higher priority / real-time applications. I’ve been trying to force specific UDP traffic through one of the two WANs I’ve setup, but so far, I can’t seem to figure out how this is done in RouterOS.

I’m doing PCC based load balancing and failover, I know it must be possible but I can’t seem to figure it out. Is this done purely as a filtering rule?
Thanks in advance!

State the requirements clearly, which ports for example…

Post the config <----------
/export file=anynamyouwish ( minus router serial number, any public WANIP information, keys etc, dont need long lease lists either LOL )

Oh, I wasn’t expecting to get my “homework done” more of a quick lesson or a pointer since a search did not provide a solution for me (maybe I’m not searching properly?)

The ports are TCP 27015, 27036; UDP 27015, 27031-27036 (this would be for some online games, I would also have to deal with other traffic such as teams / skype) Basically one of the WANs has a much higher latency than the other.

But again, I’m still learning and getting a complete solution handed out to me wouldn’t really help me understand everything, for example I think I’m lacking some basic fundamental logic to reason how the traffic should be handled in this case.

Ports, IPs easy to deal with, traffic types… you got the wrong router to do that.
Its all a matter of mangling for the most part.

Identify any vlans coming into specific WANs - mangle for that
Identify any incoming port forwarding - mangle for that
Identify the load balancing - mangle for that

Table(s) required
IP routes required
+++++++++++++++++++++++++++
Now adding in specific traffic that you want to avoid being PCC loaded…
In mangling, do it before the Load Balancing mangling. ( aka before LAN traffic gets directed )
Identify the traffic using forward chain and action=accept…

  • be it ports, be it a list of IPs ( source address list ) be it a subnet.

The next part is which WAN for this traffic, well easy peasy if tis suppposed to go out WAN1, just ensure WAN 1 has a lower distance then WAN2 for the main table route…

I tried mangling on prerouting for the given ports, then marking the routing as belonging to WAN1 connection (using the existing markers I’m also using for the load balancing) this seemed to be working but sometimes its still being routed to wan2

http://forum.mikrotik.com/t/forcing-traffic-through-specific-wan/179350/1

Thanks.
I added a “no mark” and set the passthrough to disabled, it seems to work perfectly now (I’m still testing)

So basically, I added a mangle rule on the prerouting chain, the action is “mark connection” (where I mark it for the ISP1), then I defined the protocol and the list of ports, finally it’s set to not passthrough and also under Connection Mark I set it to “no-mark” which I assume will only match unmarked incoming connections?

If this is incorrect, I’ll accept some spoon feeding :stuck_out_tongue:

Thanks I did read you requested the config but I’m really trying to learn. Sometimes just copying a solution doesn’t help.
I reckon the reason some people dislike RouterOS is simply because you do require some basic - medium understanding of networking, it’s not really meant for a random home user.
But the more you learn the better it gets.