Now, expanding on this we need solve additional requirement from the original post. How to prevent peer from coming back up. Well, for that we could probably use EEM. Let's take a look.
event manager applet DISABLE_PEER event routing network 2.2.2.2/32 type remove action 10 cli command "enable" action 20 cli command "configure terminal" action 30 cli command "router bgp 1" action 40 cli command "neighbor 2.2.2.2 shutdown" action 50 cli command "end" ! Enabling peer on R2. R1#sh ip bgp sum BGP router identifier 1.1.1.1, local AS number 1 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2.2.2.2 4 2 6 5 1 0 0 00:00:37 0 Killing the interface on R2 here. *Mar 29 01:33:59.679: %TRACKING-5-STATE: 1 ip sla 1 reachability Up->Down *Mar 29 01:33:59.683: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down Route to peer lost *Mar 29 01:33:59.747: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:DISABLE_PEER) -- Marko Milivojevic - CCIE #18427 Senior Technical Instructor - IPexpert YES! We include 400 hours of REAL rack time with our Blended Learning Solution! Mailto: [email protected] Telephone: +1.810.326.1444 Fax: +1.810.454.0130 Web: http://www.ipexpert.com/ On Sun, Mar 28, 2010 at 17:05, Marko Milivojevic <[email protected]> wrote: > On Sun, Mar 28, 2010 at 17:00, Narbik Kocharians <[email protected]> wrote: >> Totally understand that, but i did not see any mention of OSPF or ISIS. > > Enjoy. > > R1: > > interface Loopback0 > ip address 1.1.1.1 255.255.255.255 > ! > interface FastEthernet0/0 > ip address 12.12.12.1 255.255.255.0 > ! > ip sla 1 > icmp-echo 12.12.12.2 > frequency 5 > ! > ip sla schedule 1 start-time now life forever > ! > track 1 ip sla 1 reachability > default-state down > ! > ip route 2.2.2.2 255.255.255.255 12.12.12.2 track 1 > ! > route-map Neighbor-Alive > match source-protocol static > ! > router bgp 1 > neighbor 2.2.2.2 remote-as 2 > neighbor 2.2.2.2 update-source Loopback0 > neighbor 2.2.2.2 ebgp-multihop 2 > neighbor 2.2.2.2 fall-over route-map Neighbor-Alive > ! > > R2: > > interface GigabitEthernet0/0 > ip address 12.12.12.2 255.255.255.0 > ! > router bgp 2 > neighbor 1.1.1.1 remote-as 1 > neighbor 1.1.1.1 ebgp-multihop 2 > neighbor 1.1.1.1 update-source Loopback0 > ! > > Notice what happens on R1 as soon as I shut down the port on R2 (there > is a switch between them). > > *Mar 29 00:59:19.679: %TRACKING-5-STATE: 1 ip sla 1 reachability Up->Down > *Mar 29 00:59:19.683: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down Route to peer > lost > > > -- > Marko Milivojevic - CCIE #18427 > Senior Technical Instructor - IPexpert > > YES! We include 400 hours of REAL rack > time with our Blended Learning Solution! > > Mailto: [email protected] > Telephone: +1.810.326.1444 > Fax: +1.810.454.0130 > Web: http://www.ipexpert.com/ > _______________________________________________ For more information regarding industry leading CCIE Lab training, please visit www.ipexpert.com
