Sun Jan 16, 2022 11:10 pm
dst-address=0.0.0.0/0 gwy=ISP1 distance=5 check-gateway=ping
dst-address=0.0.0.0/0 gwy=ISP2 distance=10
In this way all traffic will be sent over ISP1, if it goes down, traffic will be diverted to ISP2 until such time ISP1 is back online.
If you need some traffic to go out ISP2 all the time..........
Then, assuming VER7 firmware, you need a third route
First create a table using Winbox Terminal window CLI
/routing table add name=bypass-reason fib
/ip route
dst-address=0.0.0.0/0 gwy=ISP2 table=bypass-reason distance=10
A Route rule associated:
Src-address= specific IP or a subnet
OR
An interface
Action = Lookup-ONLY-IN-Table
Table=bypass-reason
Note: If you want the bypass to revert to the ISP1 connection, if WAN2 is down, then simply use ACTION:LOOKUP.
++++++++++++++++++++++++++++++++++
example......... we want to send one LAN subnet out wan 2 all the time............ 192.168.50.0/24 gaming subnet
Step1. - table creation
/routing table add name=bypass-gaming fib
Step2. - route creation
dst-address=0.0.0.0/0 gwy=WAN2 table=bypass-gaming distance=10
Step3. - route rule creation
Scr-address=192.168.50.0/24 ( or use interface=vlanXX, if subnet is a vlan also)
Action: Lookup
Table: bypass-gaming
note: I opted to send gaming subnet out WAN2 but in case WAN2 is not available they can still use WAN1.
If they are never allowed to use ISP1 then the action would be lookup-only-in-table.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The next question you have to answer is do both your ISPs automatically come backup online when they get interrupted.
a. dynamic IPs change leases
b. power outages etc.
The way to test this is to have one ISP hooked up at a time. Hit the release, then the renew button on the IP DHCP CLient.
Do you have interne access back - check in IP DCHP Client under advanced properties that the gateway and IP address are updated and present.
This does not necessarily mean the entries in your IP routes have been updated!!!
-other methods to be sure of router IP behaviour.
Check by disabling the ethernet interface and then re-nabling it.
Pull power on the modem and then reapply after 30 seconds.
Reboot the router.
Remove power from the router and plug back in for 30 seconds......
If not able to access the internet afterwards,, then you need to add scripts to your IP DHCP Client settings.
For example on my dual wan scenario my straight plane jane cable modem connection always comes back automatically
My bell fibre ISP modem, using a vlan for internet, always repopulates the advanced settings so I see the new IP and gateway but doesnt populate by manually created IP routes.
Thus I use a script to ensure they are repopulated.
Final question or potential setup step..........
Most people use some sort of recursive routing after mastering the items above.
They do this because its possible that your link to ISP1 via their modem is up and running but from the ISP to the internet is down.
Recursive routing means you check INTERNET sites via your ISP to confirm an end to end connection.
Folks often use TWO different sites, like google for one and Open DNS for the other.
In that way, they quickly confirm with two known sites if truly ISP1 is down before switching to ISP2.
Now, there is no need to do recursive routing on the second ISP because there is no other backup, if its not working you have no alternative. Something people dont logically think through
and needlessly complicate their setup.
GLuck!!
Last edited by
anav on Sun Jan 16, 2022 11:42 pm, edited 1 time in total.