21 พฤศจิกายน 2565

Mikrotik 2 WAN failover with recursive routing

RouterOS7

WAN1 port ether1 gateway 192.168.1.1
WAN2 port ehter2 gateway 192.168.2.1

/ip/address/
add address=192.168.1.2/24 interface=ether1
add address=192.168.2.2/24 interface=ether2


/ip/route/
add dst-address=1.0.0.1 gateway=192.168.1.1 scope=10 comment="Recursive WAN1"
add dst-address=8.8.4.4 gateway=192.168.2.1 scope=10 comment="Recursive WAN2"
add gateway=1.0.0.1 check-gateway=ping distance=1 target-scope=30 comment="Route WAN1"
add gateway=8.8.4.4 check-gateway=ping distance=2 target-scope=30 comment="Route WAN2"

/ip/firewall/nat/
add chain=srcnat out-interface=ether1 action=masquerade comment="NAT WAN1"
add chain=srcnat out-interface=ether2 action=masquerade comment="NAT WAN2"