cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
9599
Views
10
Helpful
5
Replies

pre-pend default route within BGP

jdriley
Level 1
Level 1

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 5

Harold Ritter
Cisco Employee
Cisco Employee

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

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

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

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

Thanks

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

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