Depending on the ports number mark their connection using firewall mangles , then mark their routing , and at ip routes use these marks for forwarding to specific WANs , example let’s say you want to forward port 22000 to WAN1 and port 33000 to WAN2
use these:
chain=prerouting action=mark-connection new-connection-mark=WAN1
passthrough=yes protocol=tcp in-interface=LAN dst-port=22000
connection-mark=no-mark log=no log-prefix=“”
chain=prerouting action=mark-connection new-connection-mark=WAN2
passthrough=yes protocol=tcp in-interface=LAN dst-port=33000
connection-mark=no-mark log=no log-prefix=“”
chain=prerouting action=mark-routing new-routing-mark=RWAN1
passthrough=no in-interface=LAN connection-mark=WAN1 log=no
log-prefix="
chain=prerouting action=mark-routing new-routing-mark=RWAN2
passthrough=no in-interface=LAN connection-mark=WAN2 log=no
log-prefix="
Add the above at ip>firewall>mangle and replace LAN by the name of your output interface, this is for marking your specific ports, now you have to add the routing , so add these at ip>routes :
dst-address=0.0.0.0/0 gateway=××××.××××.××××.×××× (ip of WAN1)
distance=1 scope=255 target-scope=10 routing-mark=RWAN1
dst-address=0.0.0.0/0 gateway=××××.××××.××××.×××× (ip of WAN2)
distance=1 scope=255 target-scope=10 routing-mark=RWAN2