msgbartop
msgbarbottom

11 Feb 15 EEM Script to shut and no shut BGP Neighbor – Cisco IOS

I am loving EEM Scripting so far. Had a need recently to accomplish the following with a script:
EEM Script 1 – Shutdown BGP Neighbor

  • Shut down BGP Neighbor
  • Add a static Route
  • Shutdown Multilink Interface
  • Save Config

EEM Script 2 – Re Enable BGP Neighbor

  • Un shut BGP Neighbor
  • Remove static route
  • Re enable Multilink Interface
  • Save Config

In order to accomplish these two tasks I created two separate scripts.

event manager applet bgp_shut
event none
action 1.0 cli command “enable”
action 1.1 cli command “conf t”
action 1.2 cli command “router bgp 65081”
action 1.3 cli command “neighbor 10.138.128.130 shutdown”
action 1.4 cli command “exit”
action 1.5 cli command “ip route 0.0.0.0 0.0.0.0 10.255.255.105”
action 1.6 cli command “int multi 1”
action 1.7 cli command “shut”
action 1.8 cli command “end”
action 1.9 cli command “wr mem”

event manager applet bgp_noshut
event none
action 1.0 cli command “enable”
action 1.1 cli command “conf t”
action 1.2 cli command “router bgp 65081”
action 1.3 cli command “no neighbor 10.138.128.130 shutdown”
action 1.4 cli command “exit”
action 1.5 cli command “no ip route 0.0.0.0 0.0.0.0 10.255.255.105”
action 1.6 cli command “int multi 1”
action 1.7 cli command “no shut”
action 1.8 cli command “end”
action 1.9 cli command “wr mem”

By visiting this website and reading the content you are agreeing to the Terms and Conditions of this website

Tags: , , ,

Leave a Comment

WordPress SEO