Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 48 additions & 6 deletions data/ci/known-good/ci-apiv4-b2-rs1-lan1-ipv4.conf
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,23 @@ function ixp_community_filter(int peerasn)
return false;

# AS path prepending
if (routeserverasn, 103, peerasn) ~ bgp_large_community then {
if (routeserverasn, 103, peerasn) ~ bgp_large_community || (routeserverasn, 65503, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 102, peerasn) ~ bgp_large_community then {
} else if (routeserverasn, 102, peerasn) ~ bgp_large_community || (routeserverasn, 65502, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 101, peerasn) ~ bgp_large_community then {
} else if (routeserverasn, 101, peerasn) ~ bgp_large_community || (routeserverasn, 65501, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 103, 0) ~ bgp_large_community then {
} else if (routeserverasn, 103, 0) ~ bgp_large_community || (routeserverasn, 65503, 3) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 102, 0) ~ bgp_large_community then {
} else if (routeserverasn, 102, 0) ~ bgp_large_community || (routeserverasn, 65502, 2) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 101, 0) ~ bgp_large_community then {
} else if (routeserverasn, 101, 0) ~ bgp_large_community || (routeserverasn, 65501, 1) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
}

Expand Down Expand Up @@ -340,6 +340,20 @@ int set allas;
# RFC 8326 - facilitate Graceful BGP Session Shutdown
if (65535, 0) ~ bgp_community then bgp_local_pref = 0;

# Auto-append large communities when corresponding standard communities are detected.
# Per-peer variant: a standard community of (65501|65502|65503, peer) gets the
# large community (routeserverasn, 65501|65502|65503, peer) appended.
for pair pc in bgp_community do {
if pc.asn = 65501 then bgp_large_community.add( (routeserverasn, 65501, pc.data) );
if pc.asn = 65502 then bgp_large_community.add( (routeserverasn, 65502, pc.data) );
if pc.asn = 65503 then bgp_large_community.add( (routeserverasn, 65503, pc.data) );
}
# All-peers variant: a standard community of (routeserverasn, 65501|65502|65503) gets
# the large community (routeserverasn, 65501|65502|65503, 1|2|3) appended.
if (routeserverasn, 65501) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65501, 1) );
if (routeserverasn, 65502) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65502, 2) );
if (routeserverasn, 65503) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65503, 3) );

# Filter small prefixes
if ( net ~ [ 0.0.0.0/0{25,32} ] ) then {
bgp_large_community.add( IXP_LC_FILTERED_PREFIX_LEN_TOO_LONG );
Expand Down Expand Up @@ -598,6 +612,20 @@ int set allas;
# RFC 8326 - facilitate Graceful BGP Session Shutdown
if (65535, 0) ~ bgp_community then bgp_local_pref = 0;

# Auto-append large communities when corresponding standard communities are detected.
# Per-peer variant: a standard community of (65501|65502|65503, peer) gets the
# large community (routeserverasn, 65501|65502|65503, peer) appended.
for pair pc in bgp_community do {
if pc.asn = 65501 then bgp_large_community.add( (routeserverasn, 65501, pc.data) );
if pc.asn = 65502 then bgp_large_community.add( (routeserverasn, 65502, pc.data) );
if pc.asn = 65503 then bgp_large_community.add( (routeserverasn, 65503, pc.data) );
}
# All-peers variant: a standard community of (routeserverasn, 65501|65502|65503) gets
# the large community (routeserverasn, 65501|65502|65503, 1|2|3) appended.
if (routeserverasn, 65501) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65501, 1) );
if (routeserverasn, 65502) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65502, 2) );
if (routeserverasn, 65503) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65503, 3) );

# Filter small prefixes
if ( net ~ [ 0.0.0.0/0{25,32} ] ) then {
bgp_large_community.add( IXP_LC_FILTERED_PREFIX_LEN_TOO_LONG );
Expand Down Expand Up @@ -771,6 +799,20 @@ int set allas;
# RFC 8326 - facilitate Graceful BGP Session Shutdown
if (65535, 0) ~ bgp_community then bgp_local_pref = 0;

# Auto-append large communities when corresponding standard communities are detected.
# Per-peer variant: a standard community of (65501|65502|65503, peer) gets the
# large community (routeserverasn, 65501|65502|65503, peer) appended.
for pair pc in bgp_community do {
if pc.asn = 65501 then bgp_large_community.add( (routeserverasn, 65501, pc.data) );
if pc.asn = 65502 then bgp_large_community.add( (routeserverasn, 65502, pc.data) );
if pc.asn = 65503 then bgp_large_community.add( (routeserverasn, 65503, pc.data) );
}
# All-peers variant: a standard community of (routeserverasn, 65501|65502|65503) gets
# the large community (routeserverasn, 65501|65502|65503, 1|2|3) appended.
if (routeserverasn, 65501) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65501, 1) );
if (routeserverasn, 65502) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65502, 2) );
if (routeserverasn, 65503) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65503, 3) );

# Filter small prefixes
if ( net ~ [ 0.0.0.0/0{25,32} ] ) then {
bgp_large_community.add( IXP_LC_FILTERED_PREFIX_LEN_TOO_LONG );
Expand Down
40 changes: 34 additions & 6 deletions data/ci/known-good/ci-apiv4-b2-rs1-lan1-ipv6.conf
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,23 @@ function ixp_community_filter(int peerasn)
return false;

# AS path prepending
if (routeserverasn, 103, peerasn) ~ bgp_large_community then {
if (routeserverasn, 103, peerasn) ~ bgp_large_community || (routeserverasn, 65503, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 102, peerasn) ~ bgp_large_community then {
} else if (routeserverasn, 102, peerasn) ~ bgp_large_community || (routeserverasn, 65502, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 101, peerasn) ~ bgp_large_community then {
} else if (routeserverasn, 101, peerasn) ~ bgp_large_community || (routeserverasn, 65501, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 103, 0) ~ bgp_large_community then {
} else if (routeserverasn, 103, 0) ~ bgp_large_community || (routeserverasn, 65503, 3) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 102, 0) ~ bgp_large_community then {
} else if (routeserverasn, 102, 0) ~ bgp_large_community || (routeserverasn, 65502, 2) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 101, 0) ~ bgp_large_community then {
} else if (routeserverasn, 101, 0) ~ bgp_large_community || (routeserverasn, 65501, 1) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
}

Expand Down Expand Up @@ -374,6 +374,20 @@ int set allas;
# RFC 8326 - facilitate Graceful BGP Session Shutdown
if (65535, 0) ~ bgp_community then bgp_local_pref = 0;

# Auto-append large communities when corresponding standard communities are detected.
# Per-peer variant: a standard community of (65501|65502|65503, peer) gets the
# large community (routeserverasn, 65501|65502|65503, peer) appended.
for pair pc in bgp_community do {
if pc.asn = 65501 then bgp_large_community.add( (routeserverasn, 65501, pc.data) );
if pc.asn = 65502 then bgp_large_community.add( (routeserverasn, 65502, pc.data) );
if pc.asn = 65503 then bgp_large_community.add( (routeserverasn, 65503, pc.data) );
}
# All-peers variant: a standard community of (routeserverasn, 65501|65502|65503) gets
# the large community (routeserverasn, 65501|65502|65503, 1|2|3) appended.
if (routeserverasn, 65501) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65501, 1) );
if (routeserverasn, 65502) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65502, 2) );
if (routeserverasn, 65503) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65503, 3) );

# Filter small prefixes
if ( net ~ [ ::/0{49,128} ] ) then {
bgp_large_community.add( IXP_LC_FILTERED_PREFIX_LEN_TOO_LONG );
Expand Down Expand Up @@ -556,6 +570,20 @@ int set allas;
# RFC 8326 - facilitate Graceful BGP Session Shutdown
if (65535, 0) ~ bgp_community then bgp_local_pref = 0;

# Auto-append large communities when corresponding standard communities are detected.
# Per-peer variant: a standard community of (65501|65502|65503, peer) gets the
# large community (routeserverasn, 65501|65502|65503, peer) appended.
for pair pc in bgp_community do {
if pc.asn = 65501 then bgp_large_community.add( (routeserverasn, 65501, pc.data) );
if pc.asn = 65502 then bgp_large_community.add( (routeserverasn, 65502, pc.data) );
if pc.asn = 65503 then bgp_large_community.add( (routeserverasn, 65503, pc.data) );
}
# All-peers variant: a standard community of (routeserverasn, 65501|65502|65503) gets
# the large community (routeserverasn, 65501|65502|65503, 1|2|3) appended.
if (routeserverasn, 65501) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65501, 1) );
if (routeserverasn, 65502) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65502, 2) );
if (routeserverasn, 65503) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65503, 3) );

# Filter small prefixes
if ( net ~ [ ::/0{49,128} ] ) then {
bgp_large_community.add( IXP_LC_FILTERED_PREFIX_LEN_TOO_LONG );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ function ixp_community_filter(int peerasn)

<?php if( $t->router->bgp_lc ): ?>
# AS path prepending
if (routeserverasn, 103, peerasn) ~ bgp_large_community then {
if (routeserverasn, 103, peerasn) ~ bgp_large_community || (routeserverasn, 65503, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 102, peerasn) ~ bgp_large_community then {
} else if (routeserverasn, 102, peerasn) ~ bgp_large_community || (routeserverasn, 65502, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 101, peerasn) ~ bgp_large_community then {
} else if (routeserverasn, 101, peerasn) ~ bgp_large_community || (routeserverasn, 65501, peerasn) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 103, 0) ~ bgp_large_community then {
} else if (routeserverasn, 103, 0) ~ bgp_large_community || (routeserverasn, 65503, 3) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 102, 0) ~ bgp_large_community then {
} else if (routeserverasn, 102, 0) ~ bgp_large_community || (routeserverasn, 65502, 2) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
bgp_path.prepend( bgp_path.first );
} else if (routeserverasn, 101, 0) ~ bgp_large_community then {
} else if (routeserverasn, 101, 0) ~ bgp_large_community || (routeserverasn, 65501, 1) ~ bgp_large_community then {
bgp_path.prepend( bgp_path.first );
}

Expand Down
16 changes: 16 additions & 0 deletions resources/views/api/v4/router/server/bird2/neighbors.foil.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@
# RFC 8326 - facilitate Graceful BGP Session Shutdown
if (65535, 0) ~ bgp_community then bgp_local_pref = 0;

<?php if( $t->router->bgp_lc ): ?>
# Auto-append large communities when corresponding standard communities are detected.
# Per-peer variant: a standard community of (65501|65502|65503, peer) gets the
# large community (routeserverasn, 65501|65502|65503, peer) appended.
for pair pc in bgp_community do {
if pc.asn = 65501 then bgp_large_community.add( (routeserverasn, 65501, pc.data) );
if pc.asn = 65502 then bgp_large_community.add( (routeserverasn, 65502, pc.data) );
if pc.asn = 65503 then bgp_large_community.add( (routeserverasn, 65503, pc.data) );
}
# All-peers variant: a standard community of (routeserverasn, 65501|65502|65503) gets
# the large community (routeserverasn, 65501|65502|65503, 1|2|3) appended.
if (routeserverasn, 65501) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65501, 1) );
if (routeserverasn, 65502) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65502, 2) );
if (routeserverasn, 65503) ~ bgp_community then bgp_large_community.add( (routeserverasn, 65503, 3) );

<?php endif; ?>
# Filter small prefixes
<?php if( $t->router->protocol == 6 ): ?>
if ( net ~ [ ::/0{<?= config( 'ixp.irrdb.min_v6_subnet_size', 48 ) == 128 ? 128 : config( 'ixp.irrdb.min_v6_subnet_size', 48 ) + 1 ?>,128} ] ) then {
Expand Down