Community discussions

MikroTik App
 
BassTeQ
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Fri Jan 19, 2018 5:52 am

Run script when a gateway fails over

Tue Apr 16, 2019 8:53 am

Hi, I have a failover gateway configured as per this example https://wiki.mikrotik.com/wiki/Two_gateways_failover
How can I trigger my dyndns update script to run when the gateways switch between primary and secondary?

Thanks
 
BassTeQ
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Fri Jan 19, 2018 5:52 am

Re: Run script when a gateway fails over

Tue Apr 23, 2019 2:54 am

Anyone? Surely someone has done this before.

Thanks
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 2098
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Krugersdorp (Home town of Brad Binder)
Contact:

Re: Run script when a gateway fails over

Tue Apr 23, 2019 3:46 am

Based on the limited information you provided, this should be sufficient:

Create / run a script to pick up active wan IP
 
facubertran
just joined
Posts: 19
Joined: Sat Sep 24, 2016 4:18 pm
Location: Argentina
Contact:

Re: Run script when a gateway fails over

Tue Apr 23, 2019 4:03 am

 
BassTeQ
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Fri Jan 19, 2018 5:52 am

Re: Run script when a gateway fails over

Tue Apr 23, 2019 4:26 am

Thanks, that script looks good!
I see you have to hard code the gateway IP, my ISP provides dynamic information so it can change, is there any way to update the script to get the correct gateway from the DHCP client?

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

Re: Run script when a gateway fails over

Tue Apr 23, 2019 4:56 pm

I am waiting for the post that shows reality. Two wans, two dynamic IP addresses and one of them is not simple cable that just simply loads but it is fibre op where one has to read the IP address from the client side and then stick it into the routing rule. I can get failover to work from fibre to cable (wan1 to wan2) but it will never go back because the fibre op IP has changed and there is no way, other than manually to insert the correct wan1 gateway IP. I have a dydndns name but I would like to be able to do all of this without that and solely use the MT cloud.

Who is online

Users browsing this forum: dazzaling69, erlinden, grayfoxbsd, Question, tarfox and 152 guests