Need Help with Policy Routing for 2 WAN


I’m really stuck about policy routing in linux.
Hope you can help me figure out.
So, my server have 2 WAN, first is default WAN A with public IP that directly connect to modem and second is WAN B that is connected to mikrotik router.

The problem is that connected to mikrotik router, I had dst-nat in mikrotik router that forward the connection to server but it’s not working as I know this is because the dual WAN in server.


In mikrotik the default WAN is ISP A.
I had dst-nat that redirect connection to server from IP A that is not working.

This is ip route in server:
for now I just add so subnet can access the server and server can access the subnet. but outside router still can’t access using dst-nat via

default via dev eno4 proto static metric 102
default via dev br0 proto static metric 425 dev eno4 proto kernel scope link src metric 102 dev br0 scope link dev br0 proto kernel scope link src metric 425

dst-nat in mikrotik:

add action=dst-nat chain=dstnat dst-address=
! dst-address-type=local dst-port=8765 protocol=tcp
to-addresses= to-ports=8765

What do I need in routing so dst-nat will work?

Thank you

See the policy-based routing description for RHEL 9: Chapter 26. Configuring policy-based routing to define alternative routes Red Hat Enterprise Linux 9 | Red Hat Customer Portal