But because this was a complicated setup I was forced to use a bash script under the “/sbin/ifup”.
The script looked like this:
DMZ_INTERFACE=”eth0″ #we should have an IP address on this network – 188.8.131.52/24
LAN_INTERFACE_1=”eth1″ #we should have an IP address on this network – 10.12.0.0/24
EXTIPADDR=”184.108.40.206″ #an dmz gateway
INTIPADDR=”10.12.0.254″ #all the internal traffic
This is one of the cases where the passive check of the Nagios monitoring system comes in handy as we need to be informed immediately when the Keepalived changes state. So you will need an NSCA system implemented with your Nagios configuration.
Studying the Keepalived configuration we found that the authors have implemented the option to run a script that when the state of the VRRP changes. The script I’m referring to is run under the “notify” option.