Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

BGP conditional advertisement

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

BGP conditional advertisement

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

8 REPLIES
Purple

BGP conditional advertisement

Hi,

add this:

route-map ADVERT-MAP permit 20

Regards.

Alain

Don't forget to rate helpful posts.
New Member

BGP conditional advertisement

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

Purple

BGP conditional advertisement

Hi,

clear the BGP peering with clear ip bgp out *

Regards.

Alain

Don't forget to rate helpful posts.
New Member

BGP conditional advertisement

Did it. Still the same..

Purple

BGP conditional advertisement

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.
New Member

BGP conditional advertisement

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).

BGP conditional advertisement

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

New Member

BGP conditional advertisement

Thank you.

645
Views
0
Helpful
8
Replies