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. And see here for current known issues.

New Member

pre-pend default route within BGP

We are using the neighbor default-originate command to advertise the default route into the BGP AS. We have two gateways into the service providers network and the default gateway needs to be advertised out of each, but one needs to be the primary. On both router gateways we have configured the default-originate command, and 0.0.0.0 is advertised successfully. Alongside this we have configured the as-path prepend command on one of the routers. The problem is that all other routes are being prepended successfully, but the default route is not being set with the prepend path. I think this is because it is not a redistributed route from the other routing protocol and it is also as if default-originate command is bypassing the pre-pend route map statement. Example configuration below:

router bgp 64525

no synchronization

bgp log-neighbor-changes

redistribute static route-map redistribute-static

redistribute eigrp 2 route-map EIGRP-into-BGP

neighbor 10.211.22.66 remote-as 8434

neighbor 10.211.22.66 default-originate route-map BGP-METRIC

neighbor 10.211.22.66 distribute-list 10 in

neighbor 10.211.22.66 route-map as-prepend out

distance bgp 165 165 165

no auto-summary

!

route-map as-prepend permit 10

set as-path prepend 64525 64525 64525

Can someone please advise on how the default route can be pre-pended ?

5 REPLIES
Cisco Employee

Re: pre-pend default route within BGP

John,

The default route generated via the default-originate command is kind of considered a special case and is therefore not submitted to the outbound route-map. You have two options if you want to prepend the default route.

1- Add the "set as-path prepend" to your BGP-METRIC route-map.

2- Generate the default route via a network statement (ie. network 0.0.0.0 mask 0.0.0.0 and add a 0/0 static route to null0). The default route generated in this manner will be submitted to the outbound route-map and will therefore get prepended.

Hope this helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México 
Paseo de la Reforma 222 Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
New Member

Re: pre-pend default route within BGP

Hi, thanks for initial response. What I missed from my previous mail was the BGP-METRIC route-map and as you will see we have actually tried your first suggestion but this doesnt work. I have attached route-map below, is there something I have overlooked, or should it work ?

route-map BGP-METRIC permit 10

set metric 100

!

route-map BGP-METRIC permit 20

set as-path prepend 64525 64525 64525

Cisco Employee

Re: pre-pend default route within BGP

John,

Since there is no match condition under "route-map BGP-METRIC permit 10" all traffic matches this route-map iteration and the second iteration is never used.

You need to put the "set asp-path prepend" statement under the first iteration and remove the second one as follow:

route-map BGP-METRIC permit 10

set metric 100

set as-path prepend 64525 64525 64525

Hope this helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México 
Paseo de la Reforma 222 Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
New Member

Re: pre-pend default route within BGP

Again thanks again for the help, I should have realised that.

Thanks

New Member

Thanx. Saved my time.

Thanx. Saved my time. Although i already wasted some :) with default originate . thanx once again

3619
Views
10
Helpful
5
Replies