| (Cisco IOS XE 3.16 or earlier.)
Monitor BFD peer down or similar AWS HA events using an EEM applet.
Define the following EEM environment variables:
RTB—the route table ID for the private subnet VPC route table
CIDR—destination address for the route to be updated in the route table.
The CIDR for the default route is not the private subnet in the VPC. It is the destination (remote) address that you want to reach from the VPC, which is added as a route in the AWS route table. In many cases this is a default route—0.0.0.0/0.
For example, in the AWS route table, after you've added a default route with CSR-A (ENI) as gateway, if CSR-A fails then CSR-B takes over and updates the default route in the AWS route table to point to its own ENI.
ENI—the network interface ID of the CSR 1000v gigabit interface to which traffic is routed
REGION—the AWS region of CSR 1000v and DNS IP address
Configure the EEM applet in a similar way to that shown in the following example.
In this example, the four EEM environment variables (RTB, ENI, CIDR and REGION) are set for the applet replace-route2(These variables are later used by the action 1.0 publish-event command.)
||For the REGION variable, the DNS IP address is commonly the second usable IP address in the VPC network range. For example, if the VPC network is 10.0.0.0/16, then the DNS IP would be 10.0.0.2.|
event manager environment RTB rtb-631bda06
event manager environment ENI eni-d679128f
event manager environment CIDR 0.0.0.0/0
event manager environment REGION us-west-2/10.0.0.2
event manager applet replace-route2
event syslog pattern "\(Tunnel1\) is down: BFD peer down notified"
The following command uses the previously defined EEM environment variables, which are to be used in the event of an AWS HA error.
action 1.0 publish-event sub-system 55 type 55 arg1 $RTB arg2 $CIDR arg3 $ENI arg4 $REGION
After an AWS HA error occurs, routing changes are made to the VPC's route-table-id, network-interface-id and CIDR according to the values specified in the environment variables.