cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4096
Views
0
Helpful
3
Replies

BGP Route advertisement/blocking using IP SLA ??

Hi Experts,

I would like to know the possibility of route advertisement or blocking in BGP using IP SLA ?

I know there is another feature called table-map can be used with some tweaking, but I still want to explore this option.

2 Accepted Solutions

Accepted Solutions

Hitesh Vinzoda
Level 4
Level 4

Please have a look at below config. Please try in simulator first

ip sla 99
icmp-echo 1.1.1.1 source-ip 1.1.1.2
frequency 5
ip sla schedule 99 start-time now life forever
ip sla enable reaction-alerts


event manager applet IP-SLA-99-TIMEOUT
event snmp oid 1.3.6.1.4.1.9.9.42.1.2.9.1.6.4 get-type exact entry-op eq entry-val 1 exit-op eq exit-val 2 poll-interval 5
action 1.1 cli command "enable"
action 1.2 cli command "configure terminal"
action 1.3 cli command router bgp xxxxx
action 1.4 cli command no network 2.2.2.0 mask 255.255.255.0
action 1.5 cli command end

event manager applet IP-SLA-99-OK
event snmp oid 1.3.6.1.4.1.9.9.42.1.2.9.1.6.99 get-type exact entry-op eq entry-val "2" exit-op eq exit-val "1" poll-interval 20
event snmp oid 1.3.6.1.4.1.9.9.42.1.2.9.1.6.4 get-type exact entry-op eq entry-val 2 exit-op eq exit-val 1 poll-interval 5
action 1.0 syslog msg "10.128.248.42 is reachable primary line OK"
action 1.1 cli command "enable"
action 1.2 cli command "configure terminal"
action 1.3 cli command router bgp xxxxx
action 1.4 cli command network 2.2.2.0 mask 255.255.255.0
action 1.5 cli command end

HTH

Hitesh

View solution in original post

willwetherman
Spotlight
Spotlight

Hi,

 

This can also be achieved using BGP conditional advertisements whereby you can advertise or withdraw a selected prefix based on the existence of non-existence of a route in the BGP table

 

In the following example we are using basic IP SLA to monitor IP address 10.1.1.2. This IP SLA is then associated to tracked object 1 which is then associated to a dummy route 169.10.10.10 to Null0. In the event that the IP SLA operation fails, the tracked object moves to the down state and the dummy route 169.10.10.10 is removed from the RIB.

 

BGP is then configured to advertise our selected prefix of 1.1.1.0/24 to our neighbour only in the event that the dummy route disappears. Note that the dummy route will need to be in the BGP table for this to work so you will need to add it using the network command and then filter it from being advertised to your neighbours.

 

ip sla 1

 icmp-echo 10.1.1.2

 frequency 10

ip sla schedule 1 life forever start-time now

!

track 1 ip sla 1

!

ip route 169.10.10.10 255.255.255.255 Null0 track 1

 

 

ip prefix-list ADVERTISE seq 5 permit 1.1.1.0/24

!

ip prefix-list NON_EXIST seq 5 permit 169.10.10.10/32

!

route-map ADVERTISE_MAP permit 10

 match ip address prefix-list ADVERTISE

!

route-map NON_EXIST_MAP permit 10

 match ip address prefix-list NON_EXIST

 

router bgp xxx

neighbor x.x.x.x advertise-map ADVERTISE_MAP non-exist-map NON_EXIST_MAP

network 1.1.1.0 mask 255.255.255.0

network 169.10.10.10 mask 255.255.255.255

 

This operation can also be reversed so you can advertise the prefix when our IP SLA/tracked object is up and withdraw the prefix when it fails.

Hope this helps

View solution in original post

3 Replies 3

Hitesh Vinzoda
Level 4
Level 4

Please have a look at below config. Please try in simulator first

ip sla 99
icmp-echo 1.1.1.1 source-ip 1.1.1.2
frequency 5
ip sla schedule 99 start-time now life forever
ip sla enable reaction-alerts


event manager applet IP-SLA-99-TIMEOUT
event snmp oid 1.3.6.1.4.1.9.9.42.1.2.9.1.6.4 get-type exact entry-op eq entry-val 1 exit-op eq exit-val 2 poll-interval 5
action 1.1 cli command "enable"
action 1.2 cli command "configure terminal"
action 1.3 cli command router bgp xxxxx
action 1.4 cli command no network 2.2.2.0 mask 255.255.255.0
action 1.5 cli command end

event manager applet IP-SLA-99-OK
event snmp oid 1.3.6.1.4.1.9.9.42.1.2.9.1.6.99 get-type exact entry-op eq entry-val "2" exit-op eq exit-val "1" poll-interval 20
event snmp oid 1.3.6.1.4.1.9.9.42.1.2.9.1.6.4 get-type exact entry-op eq entry-val 2 exit-op eq exit-val 1 poll-interval 5
action 1.0 syslog msg "10.128.248.42 is reachable primary line OK"
action 1.1 cli command "enable"
action 1.2 cli command "configure terminal"
action 1.3 cli command router bgp xxxxx
action 1.4 cli command network 2.2.2.0 mask 255.255.255.0
action 1.5 cli command end

HTH

Hitesh

willwetherman
Spotlight
Spotlight

Hi,

 

This can also be achieved using BGP conditional advertisements whereby you can advertise or withdraw a selected prefix based on the existence of non-existence of a route in the BGP table

 

In the following example we are using basic IP SLA to monitor IP address 10.1.1.2. This IP SLA is then associated to tracked object 1 which is then associated to a dummy route 169.10.10.10 to Null0. In the event that the IP SLA operation fails, the tracked object moves to the down state and the dummy route 169.10.10.10 is removed from the RIB.

 

BGP is then configured to advertise our selected prefix of 1.1.1.0/24 to our neighbour only in the event that the dummy route disappears. Note that the dummy route will need to be in the BGP table for this to work so you will need to add it using the network command and then filter it from being advertised to your neighbours.

 

ip sla 1

 icmp-echo 10.1.1.2

 frequency 10

ip sla schedule 1 life forever start-time now

!

track 1 ip sla 1

!

ip route 169.10.10.10 255.255.255.255 Null0 track 1

 

 

ip prefix-list ADVERTISE seq 5 permit 1.1.1.0/24

!

ip prefix-list NON_EXIST seq 5 permit 169.10.10.10/32

!

route-map ADVERTISE_MAP permit 10

 match ip address prefix-list ADVERTISE

!

route-map NON_EXIST_MAP permit 10

 match ip address prefix-list NON_EXIST

 

router bgp xxx

neighbor x.x.x.x advertise-map ADVERTISE_MAP non-exist-map NON_EXIST_MAP

network 1.1.1.0 mask 255.255.255.0

network 169.10.10.10 mask 255.255.255.255

 

This operation can also be reversed so you can advertise the prefix when our IP SLA/tracked object is up and withdraw the prefix when it fails.

Hope this helps

Thanks Both,

Let me check these two approaches in the simulator. I will get back to you guys. Give me some time.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco