Much time
has passed since my last blog entry. And now, i have some time to make some new
notes in my blog.
First,
yesterday i had a task to optimize BGP convergence between to ISP. There are a
lot o ways to optimize convergence, e.g tune BGP timers, bfd, neighbor
failover, eem and etc. I 've decided to implement an EEM (Embedded Event
Manager), cause with it i can tweak a lot of events, parameters and etc.
In out
topology we have one edge router and two ISP non directly connected routers.
Than let's
begin with BGP conf. Here is standard configuration for BGP peering
-------------------
router bgp
199430
no bgp fast-external-fallover
bgp log-neighbor-changes
neighbor 172.16.0.1 remote-as 65002
neighbor 172.16.0.1 description ISP A
neighbor 192.168.0.1 remote-as 65003
neighbor 192.168.0.1 description ISP B
!
address-family ipv4
network 10.0.0.0 mask 255.255.255.0
neighbor 172.16.0.1 activate
neighbor 172.16.0.1 soft-reconfiguration
inbound
neighbor 192.168.0.1 activate
neighbor 192.168.0.1 soft-reconfiguration
inbound
exit-address-family
----------------------
Next,
lets configure ip sla monitoring and tracking of BGP peers
---------------------
track 1 ip
sla 1 reachability
track 2 ip
sla 2 reachability
ip sla 1
icmp-echo 172.16.0.1 source-interface
GigabitEthernet0/0
frequency 5
ip sla
schedule 1 life forever start-time now
ip sla 2
icmp-echo 192.168.0.1 source-interface
FastEthernet0/0/0
frequency 5
ip sla
schedule 2 life forever start-time now
-------------------
And
finally, let's configure our EEM for tracking
event
manager applet ISP_A _DOWN
event track 1 state down
action 2.0 cli command "enable"
action 2.1 cli command "config t"
action 2.2 cli command "router bgp 65001"
action 2.3 cli command "neighbor 172.16.0.1
shutdown"
event
manager applet ISP_A_UP
event track 1 state up
action 2.0 cli command "enable"
action 2.1 cli command "config t"
action 2.2 cli command "router bgp 65001"
action 2.3 cli command "no neighbor 172.16.0.1
shutdown"
-------------------
event
manager applet ISPB_DOWN
event track 2 state down
action 2.0 cli command "enable"
action 2.1 cli command "config t"
action 2.2 cli command "router bgp 65001"
action 2.3 cli command "neighbor 192.168.0.1
shutdown"
event
manager applet ISPB_UP
event track 2 state up
action 2.0 cli command "enable"
action 2.1 cli command "config t"
action 2.2 cli command "router bgp 65001"
action 2.3 cli command "no neighbor 192.168.0.1
shutdown"
-------------------
So, when 1
imcp packet is dropped by IP SLA, track service generate down messages and then
EEM aplet, which is listening that tracking generates neighbor shutdown
command, and when neighbor returns no UP states, EEM generates "no"
command.
Комментариев нет:
Отправить комментарий