This article describes how to use event-options in Junos OS to automatically modify the device configuration when a Bidirectional Forwarding Detection (BFD) session changes state. In this example, the router dynamically adjusts the VRRP priority based on the status of a monitored BFD session.
You want the router to:
Using the below configuration,
set event-options policy bfd-fail events bfdd_state_up_to_downset event-options policy bfd-fail within 1 trigger onset event-options policy bfd-fail within 1 trigger 1set event-options policy bfd-fail attributes-match bfdd_state_up_to_down.session-id matches 110.110.110.1set event-options policy bfd-fail then change-configuration commands "set interfaces ge-0/0/0 unit 1000 family inet address 110.110.110.62/24 vrrp-group 1 priority 99"set event-options policy bfd-fail then change-configuration commit-options log "from event bfd-fail"set event-options policy bfd-up events bfdd_trap_shop_state_upset event-options policy bfd-up within 1 trigger onset event-options policy bfd-up within 1 trigger 1set event-options policy bfd-up attributes-match bfdd_trap_shop_state_up.remote-peer matches 110.110.110.1set event-options policy bfd-up then change-configuration commands "set interfaces ge-0/0/0 unit 1000 family inet address 110.110.110.62/24 vrrp-group 1 priority 200"set event-options policy bfd-up then change-configuration commit-options log "from event bfd-up"
V1