BIRD is not prepending ASN on EBGP export.

Ochalski, Radoslaw rochalsk at akamai.com
Thu Oct 10 12:20:51 CEST 2024


Here you have same route exported via Juniper border, local ASN 20940 is prepended by default:

rochalsk at r01.border01.lon03.fab<mailto:rochalsk at r01.border01.lon03.fab>> show route advertising-protocol bgp 2a02:26f0:1880:202::1 20.135.0.0/16

Warning: License key missing; requires 'bgp' license


inet.0: 955317 destinations, 2138917 routes (950415 active, 218793 holddown, 14419 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 20.135.0.0/16           Self                                    20940 8075 I

vs bird:

Executing "/usr/sbin/birdc show route export '2a02:26f0:1780:1b::218__r03.sdn__RIB_FORWARDING' for 20.135.0.0/16 all"
Table master4:
20.135.0.0/16        unicast [23.210.49.58__r23.lon02.ien 2024-10-09] (100) [AS8075i]
        via 23.210.49.58 on ae1
        Type: BGP univ
        BGP.origin: IGP
        BGP.as_path: 8075
        BGP.next_hop: 23.210.49.58
        BGP.med: 4294967294
        BGP.local_pref: 350
        BGP.community: (20940,70) (20940,90) (20940,30102) (65501,8075) (20940,550)
        BGP.large_community: (4200000000, 0, 20679)


Kind Regards,

Radek


From: Alexander Zubkov <green at qrator.net>
Date: Wednesday, October 9, 2024 at 6:01 PM
To: "Ochalski, Radoslaw" <rochalsk at akamai.com>
Cc: Ondrej Zajicek <santiago at crfreenet.org>, Bird-users <bird-users at network.cz>
Subject: Re: BIRD is not prepending ASN on EBGP export.

Most vendors do not allow multiple local AS numbers, I think. The fact you receive the route over iBGP tells nothing about its origin, because external routes are passed over iBGP as well. Could you imagine a straightforward universal algorithm
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender

This message came from outside your organization.



ZjQcmQRYFpfptBannerEnd
Most vendors do not allow multiple local AS numbers, I think. The fact you receive the route over iBGP tells nothing about its origin, because external routes are passed over iBGP as well. Could you imagine a straightforward universal algorithm for guessing that the route is originated by your iBGP AS number?

On Wed, Oct 9, 2024 at 4:13 PM Ochalski, Radoslaw <rochalsk at akamai.com<mailto:rochalsk at akamai.com>> wrote:
We receive this route via IBGP on IBPG session and then exporting it to EBGP, I am pretty sure most vendor implementations will automatically prepend IBGP ASN. Otherwise, we are missing one ASN in ASPATH and attracting more traffic.

Yes, I am aware we can prepend it, though it seems strange this is not default behavior.

Kind Regards,

Radek


From: Alexander Zubkov <green at qrator.net<mailto:green at qrator.net>>
Date: Wednesday, October 9, 2024 at 3:30 PM
To: "Ochalski, Radoslaw" <rochalsk at akamai.com<mailto:rochalsk at akamai.com>>
Cc: Ondrej Zajicek <santiago at crfreenet.org<mailto:santiago at crfreenet.org>>, Bird-users <bird-users at network.cz<mailto:bird-users at network.cz>>
Subject: Re: BIRD is not prepending ASN on EBGP export.

Hi Radoslaw, In your case, how should BIRD know in what ASN the routes are originating? The AS number appears when you do export via eBGP session. And it uses local ASN for that. If you need your routes to pretend to be originated in AS20940,
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender

This message came from outside your organization.



ZjQcmQRYFpfptBannerEnd
Hi Radoslaw,

In your case, how should BIRD know in what ASN the routes are originating? The AS number appears when you do export via eBGP session. And it uses local ASN for that. If you need your routes to pretend to be originated in AS20940, you need to prepend AS20940 in some filter to your routes.

On Wed, Oct 9, 2024 at 11:09 AM Ochalski, Radoslaw <rochalsk at akamai.com<mailto:rochalsk at akamai.com>> wrote:
Thanks Ondrej,

So for the routes originating in AS20940, downstream will not be aware of AS20940 in the as-path it will only know private AS4290006033.

Kind Regards,

Radek


On 10/8/24, 5:18 PM, "Ondrej Zajicek" <santiago at crfreenet.org<mailto:santiago at crfreenet.org> <mailto:santiago at crfreenet.org<mailto:santiago at crfreenet.org>>> wrote:


!-------------------------------------------------------------------|
This Message Is From an External Sender
This message came from outside your organization.
|-------------------------------------------------------------------!


On Tue, Oct 08, 2024 at 04:46:07PM +0200, Alexander Zubkov via Bird-users wrote:
> Hi Radoslaw,
>
> Do I get it right, that you have 2 bgp peerings here. First your route
> passes this peering:
> AS8075 <-> AS20940
> then it passes other peering:
> AS4290006033 <-> AS4290006002
>
> Then it is an expected behaviour. Because the ASN is prepended when
> route is exported over eBGP session. And the local ASN is prepended.
> So you see that when you receive the route over the first peering, it
> is prepended with AS8075. Then it goes over the second peering, where
> it is prepended with AS4290006033.


Yes, that is true. I would add that one is not supposed to have different
local ASNs for different BGP instances that form coherent BGP router,
unless it is configured as BGP confederation or manually patched by
filters.


--
Elen sila lumenn' omentielvo


Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org<mailto:santiago at crfreenet.org> <mailto:santiago at crfreenet.org<mailto:santiago at crfreenet.org>>)
"To err is human -- to blame it on a computer is even more so."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20241010/2e5fb6fe/attachment.htm>


More information about the Bird-users mailing list