Fix: finally working now

This commit is contained in:
186526 2022-12-27 01:17:37 +08:00
parent ef9c4e765d
commit 4074719c8c
8 changed files with 14 additions and 8 deletions

1
bird/blank.conf Normal file
View File

@ -0,0 +1 @@
# Yes, It's just a blank file.

View File

@ -1,3 +1,5 @@
router id 10.0.0.101;
define LOCAL_ASN = 200536; define LOCAL_ASN = 200536;
define DOWNSTREAM_ASN = [ 140506, 200536 ]; define DOWNSTREAM_ASN = [ 140506, 200536 ];
@ -6,4 +8,6 @@ define POP = 101;
define REGION = 100; define REGION = 100;
define SELFASN = 4200000101; define SELFASN = 4200000101;
define ROUTER_IP = 2a0a:6040:a901::1;

View File

@ -82,10 +82,10 @@ function transit_import_filter(int ASN) {
} }
function transit_export_filter(int ASN) { function transit_export_filter(int ASN) {
if !is_valid() then return false;
# Delete Self eBGP Confed Path. # Delete Self eBGP Confed Path.
bgp_path.delete([4200000000..4225479999]); bgp_path.delete([4200000000..4225479999]);
if !is_valid() then return false;
pub_process_communities(ASN, 10); pub_process_communities(ASN, 10);
if bgp_path.last !~ DOWNSTREAM_ASN then return false; if bgp_path.last !~ DOWNSTREAM_ASN && source = RTS_BGP then return false;
return true; return true;
} }

View File

@ -16,9 +16,9 @@ function direct_peer_import_filter(int ASN) {
} }
function direct_peer_export_filter(int ASN) { function direct_peer_export_filter(int ASN) {
bgp_path.delete([4200000000..4225479999]);
if !is_valid() then return false; if !is_valid() then return false;
# Delete Self eBGP Confed Path. # Delete Self eBGP Confed Path.
bgp_path.delete([4200000000..4225479999]);
pub_process_communities(ASN, 10); pub_process_communities(ASN, 10);
if !is_peer_route() then return false; if !is_peer_route() then return false;
return true; return true;

View File

@ -1,5 +1,6 @@
template bgp pub_transit { template bgp pub_transit {
local as LOCAL_ASN; local as LOCAL_ASN;
ipv6 { ipv6 {
import where transit_import_filter(6939); import where transit_import_filter(6939);
export where transit_export_filter(6939); export where transit_export_filter(6939);
@ -24,4 +25,4 @@ template bgp pub_peer {
# import where downstream_import_filter(6939); # import where downstream_import_filter(6939);
# export where downstream_export_filter(6939); # export where downstream_export_filter(6939);
# }; # };
# } # }

View File

@ -20,4 +20,4 @@
# }; # };
# } # }
# } # }

View File

@ -1,5 +1,5 @@
protocol device { protocol device {
scan time 5; scan time 10;
} }
protocol kernel { protocol kernel {

View File

@ -28,6 +28,6 @@ function is_valid() {
if pub_is_invalid_net_length() then return false; if pub_is_invalid_net_length() then return false;
if is_bogon_prefix() then return false; if is_bogon_prefix() then return false;
if is_bogon_asn() then return false; if is_bogon_asn() then return false;
if is_rpki_invalid() then return false; if is_rpki_invalid() && source = RTS_BGP then return false;
return true; return true;
} }