Community discussions

MUM Europe 2020
 
Luzks
just joined
Topic Author
Posts: 2
Joined: Fri Nov 15, 2019 6:33 pm

Switch between 2 internet

Fri Nov 15, 2019 10:44 pm

Code: Select all

i have 1 wan connection and a LAN connection. I want the Mikrotik router to switch from 1 to the other when it fails to get internet access.

wan conections:
ether 1 = ethernet by LAN (ip = 192.168.194.0/30) ---->main internet connection
ether 2 = dhcp client for a cable modem/router (ip= 192.168.42.0/24)-----> secondary connection

If internet 1 goes down, make 2 the main until it comes back, i have the ether 1 connection pointing to a public ip by Src-nat because i need to specify outgoing src-address for the packets.
 
Zacharias
Forum Guru
Forum Guru
Posts: 1075
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: Switch between 2 internet

Sun Nov 17, 2019 10:40 am

In order for a simple fail over to happen, without load balancing being used, you should simply use different distances for those wan interfaces. In general....
For example, for your wan 1 ether 1 inside the routing table, you should set the distance to 1 and enable the check gateway ping then on the dhcp client for your second wan configure the distance parameter to 2.
If you loose communication with Gateway 1 then Gateway 2 will be used. When gateway 1 is reachable again it will switch back to it.
However, if gateway 1 is reachable, BUT gateway 1 for some reason has no internet access, then your router will still try to use the gateway1, because it is reachable, but you will have no internet access.
For such case, you can use some recursive routes, see the example here: https://wiki.mikrotik.com/wiki/Advanced ... _Scripting
Or you can use a tunnel like PPPoE for eth 1.
 
Luzks
just joined
Topic Author
Posts: 2
Joined: Fri Nov 15, 2019 6:33 pm

Re: Switch between 2 internet

Tue Nov 19, 2019 3:47 pm

In order for a simple fail over to happen, without load balancing being used, you should simply use different distances for those wan interfaces. In general....
For example, for your wan 1 ether 1 inside the routing table, you should set the distance to 1 and enable the check gateway ping then on the dhcp client for your second wan configure the distance parameter to 2.
If you loose communication with Gateway 1 then Gateway 2 will be used. When gateway 1 is reachable again it will switch back to it.
However, if gateway 1 is reachable, BUT gateway 1 for some reason has no internet access, then your router will still try to use the gateway1, because it is reachable, but you will have no internet access.
For such case, you can use some recursive routes, see the example here: https://wiki.mikrotik.com/wiki/Advanced ... _Scripting
Or you can use a tunnel like PPPoE for eth 1.
I do have load balance, and the problem i see is what you say, Gateway 1 is reachable even without internet access. Let me check the example and i tell you how it goes
 
Zacharias
Forum Guru
Forum Guru
Posts: 1075
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: Switch between 2 internet

Tue Nov 19, 2019 4:06 pm

Create the recursive failover and let me know...
 
lyftlynk
just joined
Posts: 1
Joined: Sat Nov 30, 2019 9:54 pm
Contact:

Re: Switch between 2 internet

Sat Nov 30, 2019 10:03 pm

I have 3 network connection, 1 Wireless 10gb and 2 ADSL each 5gb, after load balancing my Internet speed has not changed to the max speed, any clue
Network Administrator and Web Developer
 
Zacharias
Forum Guru
Forum Guru
Posts: 1075
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: Switch between 2 internet

Sun Dec 01, 2019 5:06 pm

It depends on the way you have configured your load balancing...
How did you balance your connections ? Using PCC ?

Who is online

Users browsing this forum: No registered users and 30 guests