04-17-2007 06:05 AM - edited 03-03-2019 04:34 PM
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 ?
04-17-2007 06:30 AM
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,
04-24-2007 12:13 AM
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
04-24-2007 04:20 AM
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,
04-30-2007 02:17 AM
Again thanks again for the help, I should have realised that.
Thanks
11-26-2015 08:35 AM
Thanx. Saved my time. Although i already wasted some :) with default originate . thanx once again
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