Page 1 of 1

Scripting for redundancy of 2 Mikrotik Routers

Posted: Thu May 11, 2017 9:31 am
by SL4Y3R1989
Good day Everyone

I'm quite new to Mikrotik Scripting.

I have a scenario if someone can help me.

I'm currently using 2 Routerboard CCR1072 routers running VRRP for Redundancy. Our Core Routers handle client contention ratio's, client access via PPP, client firewall and mangle rules, OSPF routing to other communication towers and so forth.

Through our management software it only allows one router to be configured according to above.

The problem i have is that i want the secondary router to have to same configuration as the main Router so if it fails, secondary router kicks in and take over the core without effecting any clients.

Is there any script i can use to accomplish the above?

your hep will be highly appreciated.

Re: Scripting for redundancy of 2 Mikrotik Routers

Posted: Thu May 11, 2017 4:12 pm
by AldoJimenez
Hello,

You should break this into two parts:

The first part are actions that will happen when the router becomes master/backup on the VRRP interface (Scripts Tab). Here you can disable and enable PPP interfaces, OSPF Networks(If needed; depending on your design), etc.

The second part is configuration sync script, that will take care of (on a schedule) syncing Firewall filters, Mangle rules, PPP settings, etc. As an option you could export the configuration section that you need and FTP to the secondary router to accomplish this task.

The Mikrotik Wiki and a lab are your friend.

Good Luck!

Re: Scripting for redundancy of 2 Mikrotik Routers

Posted: Fri May 19, 2017 8:05 pm
by nathan1
This code does exactly that - maintains two identical RouterOS boxes with the same configuration/files: https://github.com/svlsResearch/ha-mikrotik
Note, during a failover, clients WILL notice. RouterOS has no way to prevent this. However, depending on how you set it all up - users will be able to reconnect seamlessly within a few seconds.