2018-09-22 10:51:14 +00:00
|
|
|
function is_self_net() {
|
|
|
|
return net ~ [fd62:77fb:94bf::/48+];
|
|
|
|
}
|
|
|
|
|
|
|
|
function is_valid_network() {
|
|
|
|
return net ~ [
|
|
|
|
fd00::/8{44,64} # ULA address space as per RFC 4193
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2018-10-13 18:56:18 +00:00
|
|
|
roa table dn42_roa {
|
|
|
|
include "/var/lib/bird/bird6_roa_dn42.conf";
|
|
|
|
};
|
|
|
|
|
|
|
|
function check_roa() {
|
|
|
|
if (roa_check(dn42_roa, net, bgp_path.last) = ROA_INVALID) then {
|
|
|
|
print "[dn42] ROA check failed for ", net, " ASN ", bgp_path.last;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function import_filter_networks() {
|
|
|
|
if is_valid_network() && !is_self_net() then {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-10-14 08:27:14 +00:00
|
|
|
function dn42peer_import_policy() {
|
2018-10-13 18:56:18 +00:00
|
|
|
if(!check_roa()) then return false;
|
|
|
|
if(!import_filter_networks()) then return false;
|
|
|
|
}
|