This commit is contained in:
2026-01-26 14:52:04 +08:00
parent 2891ac911e
commit ce7ff04133
5 changed files with 5 additions and 52 deletions

View File

@@ -1,9 +1,6 @@
function unet_is_valid_network_v4() {
return net ~ [
10.50.0.0/16+,
10.88.0.0/16+,
10.21.0.0/16+,
10.188.0.0/16+
10.0.0.0/8+
];
}

View File

@@ -1,7 +1,6 @@
filter filter_inet4_bgp_import {
if is_self_net_inet4() then reject;
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
bgp_large_community.empty;
bgp_large_community.add((LOCAL_ASN,200,0));
accept;
}
@@ -11,15 +10,13 @@ filter filter_inet4_bgp_export {
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 reject;
bgp_large_community.empty;
accept;
}
filter filter_inet6_bgp_import {
if is_self_net_inet6() then reject;
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
bgp_large_community.empty;
bgp_large_community.add((LOCAL_ASN,200,0));# 传输到Ebgp
bgp_large_community.add((LOCAL_ASN,200,0));
accept;
}
@@ -28,7 +25,6 @@ filter filter_inet6_bgp_export {
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 reject;
bgp_large_community.empty;
accept;
}

View File

@@ -12,7 +12,6 @@ template bgp tpl_inet6_ixp {
if !is_self_net_inet6() then reject;
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
if bgp_large_community !~ [(LOCAL_ASN, 200,0)] then reject;
bgp_large_community.empty;
accept;
};
};

View File

@@ -6,15 +6,13 @@ template bgp unet_bgp_up0 {
import filter {
if !unet_is_valid_network_v4_allnet() then reject;
if unet_is_self_net() then reject;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,200,0));# 传输到Ebgp
bgp_large_community.add((UNET_ASN,200,0));
accept;
};
export filter {
if !unet_is_valid_network_v4_allnet() then reject;
if source !~ [RTS_STATIC, RTS_BGP] then reject;
if bgp_large_community !~ [(UNET_ASN, 200,0)] then reject;
bgp_large_community.empty;
accept;
};
import limit 9000 action block;
@@ -24,15 +22,13 @@ template bgp unet_bgp_up0 {
import filter {
if !unet_is_voalid_net_v6() then reject;
if unet_is_self_net_v6() then reject;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,200,0));# 传输到Ebgp
bgp_large_community.add((UNET_ASN,200,0));
accept;
};
export filter {
if !unet_is_voalid_net_v6() then reject;
if source !~ [RTS_STATIC, RTS_BGP] then reject;
if bgp_large_community !~ [(UNET_ASN, 200,0)] then reject;
bgp_large_community.empty;
accept;
};
import limit 9000 action block;
@@ -47,15 +43,13 @@ template bgp unet_bgp_up1 {
import filter {
if !unet_is_valid_network_v4() then reject;
if unet_is_self_net() then reject;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,200,0));# 传输到Ebgp
bgp_large_community.add((UNET_ASN,200,0));
accept;
};
export filter {
if !unet_is_valid_network_v4() then reject;
if source !~ [RTS_STATIC, RTS_BGP] then reject;
if bgp_large_community !~ [(UNET_ASN, 200,0)] then reject;
bgp_large_community.empty;
accept;
};
import limit 9000 action block;