Simple Dual Wan with protocol binding without load balance.

Hello,

Need to do a very basic dual wan, separate connections by protocol. This is for a single lan.

LAN: 192.168.100.0/24
WAN2 is strictly for ports 5000 & 5002 traffic
WAN2 is for all other traffic.

I found fail over scripts here http://www.jpudasaini.com.np/2013/05/simple-failover-mikrotik.html
But it doesn’t quote cover protocol binding and using at same time.
This seems too complicated for my task: https://aacable.wordpress.com/2013/11/13/mikrotik-with-multiple-wan-ips-and-port-forwarding/

Help please :slight_smile:

I think if WAN2 uses a dynamic IP, it'll become more complicated because you need to configure a route. Normally a dynamic IP has an option to Create Default Route but there is an extra setting that needs to be set in the route so we can't use the "Create Default Route" option.

From default config, if WAN2 will be a STATIC IP

Eth3,4,5 are slaves to Eth2. Edit interface Eth5 and set Master-Port to none, it'll be WAN2

Go to IP > Addresses, assign the IP to Eth5.

Go to IP > Routes, create a new route. Dst-Address=0.0.0.0/0, Routing-Mark: WAN2, Gateway will be your static Gateway.

To force outbound packets on ports 5000 & 5002 to go out on WAN2, you have to "mark" the packets with a routing mark.
IP > Firewall > Mangle, create a new rule
Chain: prerouting, Protocol: TCP, Dst-Port: 5000,5002, Action: Mark Routing, New-Routing-Mark:WAN2

Now the Mikrotik will send outbound packets out WAN2.

The source address of packets going out WAN2 are your private IP, to fix this you need to set a masquerade rule.
IP > Firewall > NAT, create a new rule
chain: srcnat, Out-Interface: Eth5, Action:masquerade