This commit is contained in:
2025-10-30 10:25:57 +08:00
parent 0a2ed5e91f
commit 947a310e20
12 changed files with 218 additions and 63 deletions

48
bird/function/unet.conf Normal file
View File

@@ -0,0 +1,48 @@
ipv4 table unet4;
ipv6 table unet6;
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+
];
}
function unet_is_valid_network_v4_anynet() {
return net ~ [
172.20.21.0/26+,
44.32.191.0/24+
];
}
function unet_is_valid_network_v4_allnet(){
if !unet_is_valid_network_v4_anynet() && !unet_is_valid_network_v4() then return false;
return true;
}
function unet_is_voalid_net_v6(){
return net ~ [
2406:840:e600::/44{44,56},
2a14:7580:9600::/40{40,56}
];
}
protocol pipe unet4_sync {
table unet4;
peer table master4;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
accept;
};
}
protocol pipe unet6_sync {
table unet6;
peer table master6;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
accept;
};
}