I have a TP-Link ER5210 router that lets me have two ISP as failover. It just does the job but it's a horrible piece of hardware.
So I purchased a RB2011UiAS-2HnD-IN. As I'm a newbie with RouterOS and it's my first Mikrotik device, I'm a little (too much) lost.
Connecting a single ISP was a piece of cake.
But I can't make two ISP work in failover.
Both ISP gives me dynamic IP, also gateways change from time to time (if I restart modem, sometimes gateway change).
This week I was reading/searching all info I could:
http://wiki.mikrotik.com/wiki/Two_gateways_failover but this is for static IP, won't work.
I learned I could use
Code: Select all
/ip address get [find interface="wan1"] address];
I'm pretty sure I'm messing things here, but this is what I know
I have to set two ports as dhcp-client
Code: Select all
/ip dhcp-client add interface=ether1 disabled=no add-default-route=yes default-route-distance=1 comment=WAN1
/ip dhcp-client add interface=ether2 disabled=no add-default-route=yes default-route-distance=2 comment=WAN2
Code: Select all
/ip firewall nat add chain=srcnat action=masquerade
Code: Select all
/ip route add check-gateway=ping comment="Primary WAN1" distance=1 gateway=[ /ip address get [/ip address find interface=ether1 ] network]
/ip route add comment="Backup WAN2" distance=2 gateway=[ /ip address get [/ip address find interface=ether2 ] network]
Something wrong? or maybe something right?
Any advice?
Thanks!!