Problem with TWO ISPs in one device

Hello there,

My situation is I have two ISP
ISP 1 - IP1, interface WAN1
ISP 2 - IP2, interface WAN2

Inside I have two private networks
LAN1: 10.0.0.0/24
LAN2: 10.20.30.0/24

I have configured the router to work like this

/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1 src-address=10.20.30.0/24
add action=masquerade chain=srcnat out-interface=WAN2 src-address=10.0.0.0/24

/ip route
add distance=1 gateway=ISP1-gw routing-mark=RLAN1
add distance=1 gateway=ISP2-gw routing-mark=RLAN2
add distance=1 gateway=ISP1-gw, ISP2-gw

/ip firewall mangle
add action=mark-routing chain=prerouting dst-address=!10.0.0.0/24 new-routing-mark=RLAN1 src-address=10.20.30.0/24
add action=mark-routing chain=prerouting dst-address=!10.20.30.0/24 new-routing-mark=RLAN2 src-address=10.0.0.0/24

Its working fine:
LAN1 goes via ISP1
LAN2 goes via ISP2
LAN1 sees LAN2 with no problem.

All good, BUT

I have one WEB server in LAN1 and one SQL server in LAN2 and …
Port forwarding does not work ? It was working when I had only one ISP to server both local networks, now its not
Can you advice me how to do what I want and make port-forwarding to work

I suggest looking on the Wiki for an example of this type of config that marks connections so that you are not examining every packet at layer 3.

You haven’t if you want port forwarding to work from any ISP to any server or just ISP 1 <> server 1 etc. but marking connections can achieve either.