11-29-2011 05:27 AM - edited 03-04-2019 02:27 PM
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.
Solved! Go to Solution.
11-29-2011 08:39 AM
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
11-29-2011 06:27 AM
Hi,
add this:
route-map ADVERT-MAP permit 20
Regards.
Alain
11-29-2011 06:36 AM
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
11-29-2011 06:41 AM
Hi,
clear the BGP peering with clear ip bgp out *
Regards.
Alain
11-29-2011 06:45 AM
Did it. Still the same..
11-29-2011 07:22 AM
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
11-29-2011 08:33 AM
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).
11-29-2011 08:39 AM
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
11-29-2011 09:04 AM
Thank you.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide