Community discussions

MikroTik App
 
flameproof
Member Candidate
Member Candidate
Topic Author
Posts: 117
Joined: Tue Sep 01, 2015 3:17 pm

Script or method to update dynamic DNS on failover interface

Fri Apr 15, 2016 11:54 am

I have a CCR1016 sitting in a remote location, connected via AirFiber to the internet backhaul. Since we get the occasional failure of the primary backhaul, I connected a 4G router to the CCR, so it can use this connection when the primary goes down.

What I now need is for a way to find out the public IP the 4G router has - the router itself doesn't offer any dynamic DNS methods built-in.

Since the setup is [CCR 10.100.0.10] -> [4G Router 10.100.0.1] -> [4G Router public x.x.x.x] the normal scripts don't work, as the public IP will never be assigned to one of the interfaces of the CCR.

I cannot also see a way to use /tool fetch as it will always try to go out of the default gateway, which is fine during failover, but I want it to run always, so I can have a way to remote into the CCR at any time over the 4G link.

Any ideas?
 
Sob
Forum Guru
Forum Guru
Posts: 6517
Joined: Mon Apr 20, 2009 9:11 pm

Re: Script or method to update dynamic DNS on failover interface

Fri Apr 15, 2016 1:24 pm

I use IP->Cloud and simply add static route to cloud.mikrotik.com (81.198.87.240, 91.188.51.139) via backup connection's gateway. It's not perfect, because addresses can change, but you could create a script that would resolve the hostname periodically and update addresses.
The same idea could be applied to /tool fetch method, and it would be even easier if you used it with your server with static address.
Excessive quoting is useless and annoying. If you use it, please consider if you could do without it.
 
flameproof
Member Candidate
Member Candidate
Topic Author
Posts: 117
Joined: Tue Sep 01, 2015 3:17 pm

Re: Script or method to update dynamic DNS on failover interface

Fri Apr 15, 2016 2:28 pm

Thanks for the idea - have tested it and it works, it's fine for what I need. Awesome!

Who is online

Users browsing this forum: Baidu [Spider], Renfrew and 209 guests