Community discussions

MikroTik App
 
pacmanfan
just joined
Topic Author
Posts: 14
Joined: Mon Jun 30, 2008 7:05 am

Failover alternatives to check-gateway=ping

Mon Jun 30, 2008 7:22 am

I have two WAN connections: The primary is a cable connection configured with DHCP Client, and the secondary is ADSL configured with PPPoE Client. I set up identical routing rules, with check-gateway=ping on the rule for the primary connection and distance=2 for the secondary, but it doesn't properly detect the gateway going down. Pinging the gateway from the CLI will time out, but yet it keeps trying to route traffic through the primary connection.

So, I'm looking for an alternative failover script to use. I came across this: http://wiki.mikrotik.com/wiki/ECMP_Failover_Script and tried to adapt it, but I didn't have any luck getting netwatch to actually disable the primary gateway. That script would be perfect, except I don't want to load balance, I just need simple failover. Can anyone help?
 
pacmanfan
just joined
Topic Author
Posts: 14
Joined: Mon Jun 30, 2008 7:05 am

Re: Failover alternatives to check-gateway=ping

Wed Jul 09, 2008 7:47 pm

Anyone?
 
User avatar
skillful
Trainer
Trainer
Posts: 552
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Failover alternatives to check-gateway=ping

Wed Jul 09, 2008 10:08 pm

Let us see the output of the following commands
ip route pr
ip route rule pr
 
pacmanfan
just joined
Topic Author
Posts: 14
Joined: Mon Jun 30, 2008 7:05 am

Re: Failover alternatives to check-gateway=ping

Wed Jul 09, 2008 11:53 pm

[pacmanfan@MikroTik] > ip route pr
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY-STATE GATEWAY                         DISTANCE INTERFACE                
 0 A S  ;;; centurytel
        0.0.0.0/0                          reachable     centurytel                      2        centurytel               
 1   S  0.0.0.0/0                          unreachable   cable                           1        cable                    
 2 ADC  10.11.192.0/24     10.11.192.1                                                   0        lan                      
 3 ADC  10.11.192.122/32   10.11.192.1                                                   0        <pppoe-user1>         
 4 ADC  10.11.192.123/32   10.11.192.1                                                   0        <pppoe-user3>     
 5 ADC  10.11.192.124/32   10.11.192.1                                                   0        <pppoe-user4>          
 6 ADC  10.11.192.125/32   10.11.192.1                                                   0        <pppoe-user2>         
 7 ADC  72.161.16.1/32     72.161.16.35                                                  0        centurytel               
[pacmanfan@MikroTik] > ip route rule pr
Flags: X - disabled, I - inactive 
 0   src-address=0.0.0.0/0 dst-address=0.0.0.0/0 action=lookup table=main 


Note that the cable interface is currently disabled, which is why the gateway state is unreachable. The problem is when the cable gateway goes down while there's still a DHCP lease--it doesn't go into "unreachable" state.
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: Failover alternatives to check-gateway=ping

Thu Jul 10, 2008 12:17 am

why is the gateway field blank, meaning no next-hop? What IP can it ping ?
 
pacmanfan
just joined
Topic Author
Posts: 14
Joined: Mon Jun 30, 2008 7:05 am

Re: Failover alternatives to check-gateway=ping

Thu Jul 10, 2008 9:41 pm

The gateway field is blank on the two static routes because I'm using gateway-interface. In Winbox, my static routes are configured like this:
#1
Destination: 0.0.0.0/0
Gateway Interface: cable
Check Gateway: ping
Type: unicast
Distance: 1
Scope: 30
Target Scope: 10

#2
Destination: 0.0.0.0/0
Gateway Interface: centurytel
Type: unicast
Distance: 2
Scope: 30
Target Scope: 10
I don't have a gateway assigned to the routes because they're assigned to my WAN interfaces by DHCP and PPPoE. That's why I'm using gateway interface on the routes. When the primary cable modem goes down, manual pings to the cable interface gateway time out, but route #1 using gateway-interface=cable stays active, instead of switching over to route #2.
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: Failover alternatives to check-gateway=ping

Thu Jul 10, 2008 9:45 pm

i dont think check-gateway will work without an IP address. There is nothing for it to ping. Any specific reason you have to use the interface-name rather than the IP for the next-hop ? Either way, it sounds like you need to setup your own failover script / netwatch rather than use check-gateway. Check-gateway=arp might work in your case, not sure.
 
pacmanfan
just joined
Topic Author
Posts: 14
Joined: Mon Jun 30, 2008 7:05 am

Re: Failover alternatives to check-gateway=ping

Fri Jul 11, 2008 7:34 pm

Now I'm using a gateway IP on route #1, and gateway-state goes to unreachable whenever I disconnect the cable modem, but route #1 still stays active! It won't switch over to using route #2.

How can I use netwatch to set up my own script? I'll gladly pay $50USD for one that works! :)
 
xezen
Long time Member
Long time Member
Posts: 628
Joined: Fri May 30, 2008 10:23 am
Location: South Africa

Re: Failover alternatives to check-gateway=ping

Wed Oct 14, 2009 8:49 am

help needed

i have a root like this
2 A S dst-address=0.0.0.0/0 gateway=xxx.xxx.xxx.xxx,yyy.yyy.yyy.yyy gateway-status=xxx.xxx.xxx.xxx reachable ether3,yyy.yyy.yyy.yyy reachable ether1
check-gateway=ping distance=1 scope=30 target-scope=10

x and y

are the address of my dsl modem
if i enable this

check-gateway=ping distance=1 scope=30 target-scope=10

does it look for that ip address or google as the modem works fine but google goes down

how ping google and if google don resolve remove from routes?

any ideas to help fix this

running 4v

Who is online

Users browsing this forum: Buechi, holvoetn, rmenkveld and 72 guests