This commit is contained in:
2026-01-26 15:39:07 +08:00
parent 99e59387c7
commit c2f483284c
3 changed files with 4 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
function function_inet4_bgp_import() {
if is_self_net_inet4() then return false;
if is_bogon_prefix() || (bgp_path.len > 100) then return false;
bgp_large_community.add((LOCAL_ASN,200,0));
return true;
}
function function_inet4_bgp_export() {
if !is_self_net_inet4() then return false;
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
if source != RTS_STATIC then reject;
if bgp_large_community !~ [(LOCAL_ASN, 200,0)] then return false;
return true;
}
function function_inet6_bgp_import() {
if is_self_net_inet6() then return false;
if is_bogon_prefix() || (bgp_path.len > 100) then return false;
bgp_large_community.add((LOCAL_ASN,200,0));
return true;
}
function function_inet6_bgp_export() {
if !is_self_net_inet6() then return false;
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
if source != RTS_STATIC then reject;
if bgp_large_community !~ [(LOCAL_ASN, 200,0)] then return false;
return true;
}
function function_inet4_ibgp_import() {
if is_self_net_inet4() then return false;
if is_bogon_prefix() then return false;
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
return true;
}
function function_inet4_ibgp_export() {
if is_self_net_inet4() then return false;
if is_bogon_prefix() then return false;
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
return true;
}
function function_inet6_ibgp_import() {
if is_self_net_inet6() then reject;
if is_bogon_prefix() then reject;
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
return true;
}
function function_inet6_ibgp_export() {
if is_self_net_inet6() then reject;
if is_bogon_prefix() then reject;
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
return true;
}