diff options
author | Asbjørn Sloth Tønnesen <asbjorn@labitat.dk> | 2021-06-18 21:34:39 +0000 |
---|---|---|
committer | Emil Renner Berthing <esmil@labitat.dk> | 2021-06-19 11:04:21 +0200 |
commit | 2251118ea48c86e84b58725fd9651ba3fcae5026 (patch) | |
tree | f100f5d9a9202bc33516d785ebd48a20031b199b /roles | |
parent | 0b9f7c5cfad16602bf2df5276a5bee18888fd618 (diff) | |
download | labitat-ansible-2251118ea48c86e84b58725fd9651ba3fcae5026.tar.gz labitat-ansible-2251118ea48c86e84b58725fd9651ba3fcae5026.tar.xz labitat-ansible-2251118ea48c86e84b58725fd9651ba3fcae5026.zip |
space_server: bird: prepare large communities
This patch prepares us for adopting Large BGP Communities (RFC 8092).
Basic format of Large BGP Communities:
<uint32_t asn>:<uint32_t function>:<uint32_t value>
We use function 1 for storing prefix type (or relation).
We then assign a value to transit, peering, customer and originated
prefixes.
Large BGP Communities
http://largebgpcommunities.net/
https://tools.ietf.org/html/rfc8092
https://tools.ietf.org/html/rfc8195
Esmil: consistent brace placement
Diffstat (limited to 'roles')
-rw-r--r-- | roles/space_server/files/bird.conf | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/roles/space_server/files/bird.conf b/roles/space_server/files/bird.conf index fbd426a..67f7419 100644 --- a/roles/space_server/files/bird.conf +++ b/roles/space_server/files/bird.conf @@ -60,8 +60,21 @@ define hafnium_prefixes_v6 = [ 2a0e:8f02:f034::/48 ]; +# large communities +define lc_f_type = 1; + +define lc_type_transit = 1; +define lc_type_peering = 2; +define lc_type_customer = 3; +define lc_type_originate = 4; + # functions and filters +function set_peer_type(int new_type) { + bgp_large_community.delete([(local_asn, lc_f_type, *)]); + bgp_large_community.add( (local_asn, lc_f_type, new_type)); +} + function is_default_route() { case net.type { NET_IP4: if net = 0.0.0.0/0 then return true; @@ -85,8 +98,7 @@ filter kernel_export { reject; } -function honor_graceful_shutdown() -{ +function honor_graceful_shutdown() { # RFC 8326 Graceful BGP Session Shutdown if (65535, 0) ~ bgp_community then { bgp_local_pref = 0; |