06-05-2018 01:52 PM - edited 03-05-2019 10:33 AM
I am trying to add a route if a site goes into backup. Is there a way to watch the vrrp status on the device and if it goes to master add route?
06-05-2018 03:23 PM - edited 06-05-2018 03:25 PM
Hello
Yes you can utilizing EEM (embedded event manager)
Obviously swap the interfaces in the actual syslog message to accommodate your setup
event manager applet VRRP-Backup
event syslog pattern "%VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Master -> Backup"
action 5.0 cli command "enable"
action 5.1 cli command "config t"
action 5.2 cli command " ip route x.x.x.x y.y.y.y z.z.z.z"
action 5.3 cli command "end"
conf t
event manager applet VRRP-Master
event syslog pattern "%VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Backup -> Master"
action 6.0 cli command "enable"
action 6.1 cli command "config t"
action 6.2 cli command "no ip route x.x.x.x y.y.y.y z.z.z.z"
action 6.3 cli command "end"
res
Paul
06-06-2018 06:36 AM
Thanks I will try that, however is there a way to add the network to EIGRP if it is in a Master state?
06-06-2018 06:51 AM - edited 06-06-2018 06:55 AM
Hello
yes just inclement the cli action to accommodate eigrp inclusion
Ex: action 5.x cli command “ router eigrp xx
action 5.x cli command “ network x.x.x.x”
action 5.x cli command “exit”
etc...
res
paul
06-19-2018 03:38 AM
I added the action items you listed. Do I have to add them to an interface or are those the only commands? Sorry I haven't used these commands before.
06-19-2018 04:09 AM
Hello
Yes just add those two applets but obvuisouly suppliment it with the correct static route addressing.
res
Paul
06-19-2018 04:19 AM
Tried it this morning and it didn't work. The log is below and my config is below it
Jun 19 05:50:39: %VRRP-6-STATECHANGE: Gi0/0/0 Grp 1 state Backup -> Master
Jun 19 05:51:03: %VRRP-6-STATECHANGE: Gi0/0/0 Grp 1 state Master -> Backup
Jun 19 05:52:18: %VRRP-6-STATECHANGE: Gi0/0/0 Grp 1 state Backup -> Master
event manager applet VRRP-Master
event syslog pattern "%%VRRP-6-STATECHANGE: Gi0/0/0 Grp 1 state Backup -> Master"
action 6.0 cli command "enable"
action 6.1 cli command "config t"
action 6.2 cli command "network XXX.XXX.XXX 0.0.0.3"
action 6.3 cli command "end"
event manager applet VRRP-Backup
event syslog pattern "%%VRRP-6-STATECHANGE: Gi0/0/0 Grp 1 state Master -> Backup"
action 5.0 cli command "enable"
action 5.1 cli command "config t"
action 5.2 cli command "no network XXX.XXX.XXX 0.0.0.3"
action 5.3 cli command "end"
I never seen anything that would have said it tried to add the network while in master status
06-19-2018 04:27 AM
You need to go into router configuration mode for EIGRP ie. after "config t" you need a "router eigrp <AS no>" before you add the network statement.
Jon
06-19-2018 04:28 AM - edited 06-19-2018 05:07 AM
Hello
Okay just noticed through Jons post that your trying to add to the eigrp not a static route, That where the confusion lies for me, In fact i did see I have added the config for the network addition into eigrp process but it wasn't that clear - So apologies.
Lastly i have also tweaked the syslog pattern to see if that helps but NOTE; the interface and group number (Fa0/0 Grp 1) will need to be change to accommodate your physical interfaces that vrrp is applied to and the group number of vrrp?
in my case it was this:
interface FastEthernet0/0
vrrp 1
I have attach two possible EEM scripts, use either.
static route
event manager applet VRRP-Backup
event syslog pattern "%VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Master -> Init"
action 5.0 cli command "enable"
action 5.1 cli command "config t"
action 5.2 cli command "ip route 1.1.1.1 255.255.255.255 null 0"
action 5.3 cli command "end"
event manager applet VRRP-Master
event syslog pattern "%VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Init -> Backup"
action 6.0 cli command "enable"
action 6.1 cli command "config t"
action 6.2 cli command "no ip route 1.1.1.1 255.255.255.255 null 0"
action 6.3 cli command "end"
eigrp process
event manager applet VRRP-Backup
event syslog pattern "%VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Master -> Init"
action 5.0 cli command "enable"
action 5.1 cli command "config t"
action 5.2 cli command "router eigrp xxx"
action 5.3 cli command "network x.x.x.x 0.0.0.0"
action 5.4 cli command "end"
event manager applet VRRP-Master
event syslog pattern "%VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Init -> Backup"
action 6.0 cli command "enable"
action 6.1 cli command "config t"
action 6.2 cli command "router eigrp xxx"
action 6.3 cli command "no network x.x.x.x 0.0.0.0"
action 6.4 cli command "end"
res
Paul
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide