Community discussions

MikroTik App
 
SL4Y3R1989
just joined
Topic Author
Posts: 6
Joined: Thu Mar 23, 2017 11:34 am
Location: South Africa
Contact:

Scripting for redundancy of 2 Mikrotik Routers

Thu May 11, 2017 9:31 am

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.
 
AldoJimenez
Trainer
Trainer
Posts: 30
Joined: Fri Feb 12, 2016 11:49 pm
Contact:

Re: Scripting for redundancy of 2 Mikrotik Routers

Thu May 11, 2017 4:12 pm

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!
 
nathan1
Member Candidate
Member Candidate
Posts: 160
Joined: Sat Jan 16, 2016 7:05 pm

Re: Scripting for redundancy of 2 Mikrotik Routers

Fri May 19, 2017 8:05 pm

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.

Who is online

Users browsing this forum: No registered users and 5 guests