This commit is contained in:
2026-06-08 17:28:53 +08:00
parent 2991b41762
commit 42fd9fcae4
4 changed files with 66 additions and 60 deletions

View File

@@ -0,0 +1,42 @@
function function_unet_import() {
if !unet_is_valid_network() then return false;
if is_unet_self_net() then return false;
bgp_large_community.add((UNET_ASN,200,0));
return true;
}
function function_unet_export() {
if !unet_is_valid_network() then reject;
if source !~ [RTS_STATIC, RTS_BGP] then reject;
if bgp_large_community !~ [(UNET_ASN, 200,0)] then reject;
accept;
}
function function_unet_only_import() {
if !unet_is_valid_network_v4() then return false;
if is_unet_self_net() then return false;
bgp_large_community.add((UNET_ASN,200,0));
return true;
}
function function_unet_only_export() {
if !unet_is_valid_network_v4() then return false;
if source !~ [RTS_STATIC, RTS_BGP] then return false;
if bgp_large_community !~ [(UNET_ASN, 200,0)] then return false;
return true;
}
function function_unet_ibgp_import() {
if bgp_large_community ~ [(UNET_ASN, 1,*)] then return false;
if !unet_is_valid_network() then return false;
if is_unet_self_net() then return false;
return true;
}
function function_unet_ibgp_export() {
if bgp_large_community ~ [(UNET_ASN, 1,*)] then return false;
if !unet_is_valid_network() then return false;
if is_unet_self_net() then return false;
return true;
}