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

35
bird/function/dn42.conf Normal file
View File

@@ -0,0 +1,35 @@
ipv4 table dn42v4;
ipv6 table dn42v6;
function dn42_is_valid_network() {
return net ~ [
172.20.0.0/14{21,29}, # dn42
172.20.0.0/24{28,32}, # dn42 Anycast
172.21.0.0/24{28,32}, # dn42 Anycast
172.22.0.0/24{28,32}, # dn42 Anycast
172.23.0.0/24{28,32}, # dn42 Anycast
];
}
function dn42_is_valid_network_v6() {
return net ~ [
fd00::/8{44,64} # ULA address space as per RFC 4193
];
}
protocol pipe dn42v6_sync {
table dn42v4;
peer table master4;
export filter {
if bgp_large_community ~ [(DN42_ASN, 3,*)] then reject;
accept;
};
}
protocol pipe dn42v6_sync {
table dn42v6;
peer table master6;
export filter {
if bgp_large_community ~ [(DN42_ASN, 3,*)] then reject;
accept;
};
}

22
bird/function/inet.conf Normal file
View File

@@ -0,0 +1,22 @@
ipv4 table inet4;
ipv6 table inet6;
protocol pipe inet6_sync {
table inet6;
peer table master6;
import none;
export filter {
if bgp_large_community ~ [(LOCAL_ASN, 3,*)] then reject;
accept;
};
}
protocol pipe inet4_sync {
table inet4;
peer table master4;
import none;
export filter {
if bgp_large_community ~ [(LOCAL_ASN, 3,*)] then reject;
accept;
};
}

View File

@@ -1,61 +0,0 @@
ipv4 table inet4;
ipv6 table inet6;
ipv4 table unet4;
ipv6 table unet6;
ipv4 table ospf4;
ipv6 table ospf6;
protocol pipe inet6_sync {
table inet6;
peer table master6;
import none;
export filter {
if bgp_large_community ~ [(LOCAL_ASN, 3,*)] then reject;
accept;
};
}
protocol pipe inet4_sync {
table inet4;
peer table master4;
import none;
export filter {
if bgp_large_community ~ [(LOCAL_ASN, 3,*)] then reject;
accept;
};
}
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;
};
}
protocol pipe ospf4_sync {
table ospf4;
peer table master4;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
accept;
};
}
protocol pipe ospf6_sync {
table ospf6;
peer table master6;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
accept;
};
}

View File

@@ -1,3 +1,6 @@
ipv4 table unet4;
ipv6 table unet6;
function unet_is_valid_network_v4() {
return net ~ [
10.50.0.0/16+,
@@ -25,4 +28,21 @@ function unet_is_voalid_net_v6(){
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;
};
}