Hi Kurt, Thanks a lot for your reply.
I understand the logic, but I'm sure there must be a way to choose the routes one want to export? Imagine I have two upstreams, and two peered networks (say: customers). Both upstreams provide me with a (kind of) full table. I would like to export the table I get from upstream 1 to peer 1, and the table from upstream 2 to client 2 (regardless if it's the best route or not...) An "export all" is not a solution, since the packets will be redirected to one or the other upstream according to the best routes algorithm. thanks Julien Le ven. 4 janv. 2019 à 12:18, Kurt Wauters <[email protected]> a écrit : > Hi Julien, > > It probably comes down to one of the standard BGP rules. Community adding > and filtering seem to be ok but you only advertise the routes that are > "best" or for which you've got an entry in your routing table. > If you have multiple upstreams connected the routes are probably spread > over your upstreams because they all have different flavours of policy and > peering agreements. > > Kind regards > Kurt > > On Fri, Jan 4, 2019 at 8:46 AM Julien Sansonnens <[email protected]> > wrote: > >> Hi, >> >> Using BIRD 1.6.4 I want to do something very basic: export routes to a >> peer to allow transit. >> >> for that, I start by adding communities to my received routes, so I can >> distinguish the upstream. >> >> import filter { >> if !is_martian() && !is_self_net() && from = bgp_next_hop then { >> bgp_large_community.add((myas, 100, XX)); #XX for each upstream >> accept; >> } >> else reject; >> }; >> >> A community is (apparently?) added to each route. I get about 61'000 ipv6 >> routes from my upstream. >> >> Now I want to export them to "peer1". Here is my export function: >> >> function bgp_export_peer (){ >> if (myas,100,20) ~ bgp_large_community then return true; >> } >> >> here is the problem: it looks like only 123 routes are exported ! >> bird> show route export peer count >> 123 of 362489 routes for 61724 networks >> >> Here is an example of an exported route: >> >> 2001:9d8:200b::/48 via 2a06:1287:3308:c0c0::1 on peer-mmnetworks [mmnet >> 22:24:20] * (100) [AS25577i] >> Type: BGP unicast univ >> BGP.origin: IGP >> BGP.as_path: 207149 206499 204893 206313 6724 8560 25577 >> BGP.next_hop: 2a0c:b640:fffe:10:192:220:4:2 >> BGP.local_pref: 100 >> BGP.community: (666,666) (997,6499) (6724,900) (6724,960) >> (8560,4) (8560,10000) (57555,0) (57555,4100) (57555,4101) (65010,10000) >> BGP.large_community: (206313, 206313, 206313) (207149, 100, 20) >> >> and an example of a non-exported route: >> >> 2406:3003:2032::/48 via 2a06:1287:3308:c0c0::1 on peer-mmnetworks [mmnet >> 20:48:51] (100) [AS55430i] >> Type: BGP unicast univ >> BGP.origin: IGP >> BGP.as_path: 206499 6939 38861 55430 >> BGP.next_hop: 2a06:1287:3308:c0c0::1 fe80::b9d7:d605 >> BGP.med: 0 >> BGP.local_pref: 100 >> BGP.community: (0,2906) (0,6939) (0,12876) (0,12989) (0,13335) >> (0,15133) (0,15169) (0,16265) (0,16276) (0,16509) (0,20940) (0,22822) >> (0,32934) >> BGP.large_community: (207149, 100, 20) >> >> as you see, my lare community are added on both routes. >> The exported route has my AS as the first value on the left (AS_PATH), >> which is not the case for the non-exported route. >> >> Logically, all exported routes should have my AS on the left. Am I >> missing something? It's probably logical, but I do not understand what's >> going on here. >> In the same way, I can not export any route that comes from my peers >> (direct connection), since they have only their AS in the path. >> >> help would be highly appreciated. >> cheers, Julien Sansonnens >> >> >>
