The primary router doesn't need these as if it goes down then the secondary should be enabling 2 interfaces.
The problem:
I've tried writing a script directly in the master and slave sections of the VRRP interface, and although it sends me an email (part of the script) it doesn't disable the interfaces. Strange thing is that the email part is at the end of the script so if there was an error it shouldn't even finish.
also, if I copy and paste the code into a regular script and run that, interfaces are disabled correctly and the email is sent.
Copy of the code for becoming master:
Code: Select all
/ip address set [/ip address find address=*inet address*] disabled=no
:delay 1
/interface ethernet set [/interface ethernet find name="LAN1"] disabled=no
:delay 1
/interface ethernet set [/interface ethernet find name="LAN2"] disabled=no
:delay 1
/tool e-mail send from=removed@removed.com to=removed@removed.com server=*removed* subject="Secondary router has become Master" body="Primary router appears to have failed, secondary has taken over."
:log error "Router has become Master VRRP"
Code: Select all
/ip address set [/ip address find address=*inet address*] disabled=yes
:delay 1
/interface ethernet set [/interface ethernet find name="LAN1"] disabled=yes
:delay 1
/interface ethernet set [/interface ethernet find name="LAN2"] disabled=yes
:delay 1
/tool e-mail send from=removed@removed.com to=removed@removed.com server=*removed* subject="Secondary router has become Slave" body="Primary router appears to be back online, secondary has reverted to slave."
:log error "Router has become Slave VRRP"