BGP default route and as-path-prepend

Hi everyone,

I’m having some issues getting as-path-prepend working with a default route. Specifically, I’m looking to advertise two default routes and have one as a backup for a private peer but while my prepend works for “normal” ipv4 networks, the default route resolutely advertises with a single AS hop, even when the route-map makes no distinction between them.

I’ve seen some suggestions on similar CLI’s that you have to treat the default route differently, such as using a prefix-list, which I have done and it filters 172.31 but there is no prepending.

My config as it stands:

set policy prefix-list default rule 10 action ‘permit’
set policy prefix-list default rule 10 prefix ‘0.0.0.0/0’
set policy route-map Prepend rule 2 action ‘permit’
set policy route-map Prepend rule 2 match ip address prefix-list ‘default’
set policy route-map Prepend rule 2 set as-path-prepend '64500 64500 64500 ’
set protocols bgp 64500 address-family ipv4-unicast network 0.0.0.0/0
set protocols bgp 64500 neighbor 169.254.1.1 address-family ipv4-unicast default-originate
set protocols bgp 64500 neighbor 169.254.1.1 address-family ipv4-unicast route-map export ‘Prepend’
set protocols bgp 64500 neighbor 169.254.1.1 address-family ipv4-unicast soft-reconfiguration inbound
set protocols bgp 64500 neighbor 169.254.1.1 remote-as ‘65101’
set protocols bgp 64500 neighbor 169.254.1. update-source ‘169.254.1.2’

Any thoughts?

Cheers,

Kev

Hi @kev , I think that the as-path-prepand doesn’t work with default-originate. Try to do the following instead:

  1. delete protocols bgp 64500 address-family ipv4-unicast network 0.0.0.0/0
  2. delete protocols bgp 64500 neighbor 169.254.1.1 address-family ipv4-unicast default-originate
  3. set protocols static route 0.0.0.0/0 blackhole
  4. set protocols bgp 64500 address-family ipv4-unicast redistribute connected
    set protocols bgp 64500 address-family ipv4-unicast redistribute static

After that you may see the expected behaviour:

vyos@vyos1:~$ show ip bgp ipv4 unicast neighbors 10.0.0.1 advertised-routes
BGP table version is 8, local router ID is 10.0.0.0, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0/0        0.0.0.0                  0         32768 65001 65001 65001 ?

Total number of prefixes 1

Hi Elchin,

That looks to be working great from my side, thanks a bunch! The other side will likely let me know on Monday and I can pass on some more praise :slight_smile:

Thanks again!

Kev