Community discussions

MikroTik App
 
kashifmax
newbie
Topic Author
Posts: 37
Joined: Mon Feb 22, 2016 9:53 pm

ADSL pcc and failover using IP check

Sat Sep 02, 2023 11:16 pm

Hi,
Recently set up a load balance and a failover (may be it is not recursive).

ADSL Router 1. IP :192.168.2.1
ADSL Router 2. IP :192.168.3.1.

Now the issue is that when I unplug the telephone line from any ADSL Router then the traffic is still going to 192.168.2.1 because the ADSL Router is up and also because of ping check to that gateway (192.168.2.1 or 192.168.3.1).

I tried few thing but it didn't work. Here is the output of route. Using PCC src and port method.
ip route print                                    
0   s 0.0.0.0/0       192.168.3.1         2	main
1  As 0.0.0.0/0       192.168.2.1         1	main
  DAc 192.168.1.0/24  lan          0
  DAc 192.168.2.0/24  wan1         0
  DAc 192.168.3.0/24  wan2         0
2  As 0.0.0.0/0       192.168.2.1         1	towan-1
3  As 0.0.0.0/0       192.168.3.1         1	towan-2
How can I do ping check or any other method to check for any ISP or Public? If no reply or down then it shifts to another wan link.

Need your guidance.

Thank you
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 23392
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: ADSL pcc and failover using IP check

Sun Sep 03, 2023 2:11 pm

It is not clear what you want to accomplish.
Please state clearly what you expect when both ISPs are up.
Please state what you want to occur if ISP1 is down.
Please state what you want to occur if ISP2 is down.

I am assuming both connection are from different providers.........
As well will need to see the config
/export file=anynameyouwish (minus router serial # and any public WANIP information)
 
kashifmax
newbie
Topic Author
Posts: 37
Joined: Mon Feb 22, 2016 9:53 pm

Re: ADSL pcc and failover using IP check

Sun Sep 03, 2023 3:48 pm

Thank you for your reply

ADSL leased telephone line connected to Router. If the ADSL line is disconnected then traffic still goes through it because of the gateway ping check of ADSL router (Router IP itself, 192.168.3.1 or 192.168.2.1). I want to use Public IP check instead of Router IPs (192.168.3.1 or 192.168.2.1).

So if no reply from Public IP (example 8.8.4.4) then shift traffic to 192.168.3.1 (interface ISP2) and vice versa.

Note: ISP's are different but are not important to consider as both are with same bandwidth. ADSL router IPs are dynamics which is also not important to consider as well.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4703
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: ADSL pcc and failover using IP check

Sun Sep 03, 2023 3:55 pm

Assuming your ADSL WAN IP are obtained from /ip/dhcp-client, you can add a script in the "Advanced" tab that will add a "check-gateway=ping" to the dynamic default gateways added. The will disable the route if the next-hop (WAN gateway) is not pingable.
:if ($bound=1) do={ 
   /ip route set [ /routing/route/find dst-address="0.0.0.0/0" gateway=$"gateway-address" ] check-gateway=ping 
}
It does NOT check the "internet is up", but this does check if the line to ISP is up.
 
kashifmax
newbie
Topic Author
Posts: 37
Joined: Mon Feb 22, 2016 9:53 pm

Re: ADSL pcc and failover using IP check

Sun Sep 03, 2023 4:31 pm

Thank you very much.

/ip/dhcp-client. no actually all IP's are handled by ADSL Router. Only static IP to interfaces are been set.

I tried but again the gateway is ADSL router IP including the ISP's. Sometimes ADSL line is connected but no internet from the ISP (issue at ISP). So that is why a ping to Public IP (for example 8.8.4.4) might able to solve this issue.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4703
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: ADSL pcc and failover using IP check

Sun Sep 03, 2023 5:13 pm

I tried but again the gateway is ADSL router IP including the ISP's. Sometimes ADSL line is connected but no internet from the ISP (issue at ISP). So that is why a ping to Public IP (for example 8.8.4.4) might able to solve this issue.
If the problem isn't the "last mile" (e.g. between you and ISP)... then you need "recursive routing", see https://help.mikrotik.com/docs/pages/vi ... d=26476608

Just that more involved to setup & example do not show it combined with load balancing. Although should be able to adjust the distance to match on the WAN1 and WAN2 to do that. But it is tricky to setup.
 
kashifmax
newbie
Topic Author
Posts: 37
Joined: Mon Feb 22, 2016 9:53 pm

Re: ADSL pcc and failover using IP check

Mon Sep 04, 2023 3:41 pm

I tried but again the gateway is ADSL router IP including the ISP's. Sometimes ADSL line is connected but no internet from the ISP (issue at ISP). So that is why a ping to Public IP (for example 8.8.4.4) might able to solve this issue.
If the problem isn't the "last mile" (e.g. between you and ISP)... then you need "recursive routing", see https://help.mikrotik.com/docs/pages/vi ... d=26476608

Just that more involved to setup & example do not show it combined with load balancing. Although should be able to adjust the distance to match on the WAN1 and WAN2 to do that. But it is tricky to setup.
Thank your for your guidance.

I will see to it soon.