cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1294
Views
0
Helpful
8
Replies

BGP conditional advertisement

typeonegative
Level 1
Level 1

Hello,

I have one issue configuring BGP conditional advertisement. My configuration is:

router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 200.200.200.0 mask 255.255.255.0
 neighbor 20.0.0.2 remote-as 2
 neighbor 20.0.0.2 advertise-map ADVERT-MAP exist-map EXIST-MAP
 no auto-summary
!
ip prefix-list 100 seq 5 permit 100.100.100.0/24
!
route-map EXIST-MAP permit 10
 match ip address prefix-list 100
!
route-map ADVERT-MAP permit 10
 set as-path prepend 1 1
!

I expect to have twice prepend if 100.100.100.0/24 network exist and no prepend if network 100.100.100.0/24 doesn't exist. Is it possible to do so? Because now it works only if network 100.100.100.0/24 exist, then BGP prepends twice, else no prefix advertisement..

Thank you.

1 Accepted Solution

Accepted Solutions

Marwan ALshawi
VIP Alumni
VIP Alumni

Idon't believe what you trying to do is the right way

Conditional advertisement is not used to set AS prepending but for advertising. Networks conditionally based on the route exitiance or not

This can be done by using some tricks with ip sla and EEM

For example you can have a sla track to watch the route 100.100.100.0/24

Track 10 ip route 100.100.100.0/24

Delay up 1 down 1

EEM event manger app lit

event manager applet NO-ROUTE

event track 10 state down

action 1.0 syslog msg " route 100.100.100.0 down!"

action 1.1 cli command "enable"

action 1.2 cli command " config t"

action 1.3 cli command " router bgp 1 "

action 1.4 cli command " no neighbor 20.0.0.2 route-map map1 out "

event manager applet ROUTE

event track 10 state up

action 1.0 syslog msg " route 100.100.100.0 up !"

action 1.1 cli command "enable"

action 1.2 cli command " config t"

action 1.3 cli command " router bgp 1 "

action 1.4 cli command " neighbor 20.0.0.2 route-map map1 out "

Route-map map1

Set as prepend 1 1

Hope this help

View solution in original post

8 Replies 8

cadet alain
VIP Alumni
VIP Alumni

Hi,

add this:

route-map ADVERT-MAP permit 20

Regards.

Alain

Don't forget to rate helpful posts.

Added with no success:

R2#sh ip bgp neighbors 20.0.0.2 | inc Condit

  Condition-map EXIST-MAP, Advertise-map ADVERT-MAP, status: Withdraw

R2#sh ip bgp neighbors 20.0.0.2 advertised-routes

Total number of prefixes 0

Hi,

clear the BGP peering with clear ip bgp out *

Regards.

Alain

Don't forget to rate helpful posts.

Did it. Still the same..

Hi,

just reread the BGP conditional advertisement on Cisco site and indeed what you are observing is normal behaviour.

So forget about the additional route-map I suggested before.

What do you want to achieve exactly?

Regards.

Alain

Don't forget to rate helpful posts.

I want to advertise my prefixes with twice prepend if I already have a specific route by matching it. If RIB doesn't have a specific route then advertise my prefixes normaly (without prepends).

Marwan ALshawi
VIP Alumni
VIP Alumni

Idon't believe what you trying to do is the right way

Conditional advertisement is not used to set AS prepending but for advertising. Networks conditionally based on the route exitiance or not

This can be done by using some tricks with ip sla and EEM

For example you can have a sla track to watch the route 100.100.100.0/24

Track 10 ip route 100.100.100.0/24

Delay up 1 down 1

EEM event manger app lit

event manager applet NO-ROUTE

event track 10 state down

action 1.0 syslog msg " route 100.100.100.0 down!"

action 1.1 cli command "enable"

action 1.2 cli command " config t"

action 1.3 cli command " router bgp 1 "

action 1.4 cli command " no neighbor 20.0.0.2 route-map map1 out "

event manager applet ROUTE

event track 10 state up

action 1.0 syslog msg " route 100.100.100.0 up !"

action 1.1 cli command "enable"

action 1.2 cli command " config t"

action 1.3 cli command " router bgp 1 "

action 1.4 cli command " neighbor 20.0.0.2 route-map map1 out "

Route-map map1

Set as prepend 1 1

Hope this help

Thank you.

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:

Review Cisco Networking products for a $25 gift card