pre-pend default route within BGP

Unanswered Question
Apr 17th, 2007

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 ?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Harold Ritter Tue, 04/17/2007 - 06:30

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,

jdriley Tue, 04/24/2007 - 00:13

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

Harold Ritter Tue, 04/24/2007 - 04:20

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,

jdriley Mon, 04/30/2007 - 02:17

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

Thanks

ahmad82pkn Thu, 11/26/2015 - 08:35

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

Actions

This Discussion