Trigger event handling and activation
U
SER
G
UIDE
341
set trigger gprs up ip route add 4.4.4.0/24 dev eth0
The backup status can be activated by verifying the accessibility of a remote address. For example:
set backup check-interval 5
set backup check-retries 3
set backup check-wait 1
set backup checking-ipaddress 10.10.1.1 via icmp through-interface atm0
Every
5
seconds a ICMP request (ping) message is sent to the address
10.10.1.1
: if in 1 second
and for
3
consecutive times there is no reply, the router passes into backup status.
In addition to ICMP request protocol, it is also possible to use the BFD-light protocol:
set backup checking-ipaddress 10.10.1.1 via bfd through-interface atm0
By using the appropriate trigger, further actions can be activated when passing to backup status,
for example:
set trigger backup up set gprs on
set trigger backup up set rip on
Once in backup status, Imola continues to control the accessibility of the specified IP address. When
the address is available again, the router comes back from the backup status by executing
programmed actions, for example:
set trigger backup off set rip off
set trigger backup off set gprs off
For example, it is possible to modify and control the VRRP configuration of the router:
set backup checking-ipaddress 1.1.1.1 via icmp through-interface eth0
set trigger backup up set vrrp increment-priority 50
set trigger backup up set vrrp on
set trigger backup up set vrrp decrement-priority 50
with these commands, when Imola enters in the backup status, that is when the specified address is
not available, the priority of the VRRP protocol increases so becoming Master VRRP and as a
consequence, the default network gateway (see paragraph about VRRP).
In order to execute actions repeated at prefixed intervals of time, a useful way to program Imola, is
to use the
trigger timer-tick
.
Before using this command, the frequency (in seconds) used by the router to generate the
timer-
tick
event, must be specified.
set timer-tick 3600
The periodic execution of a
CLI
command can be programmed at the occurrence of each of these
events by using the following syntax:
set trigger timer-tick <command>