Files
bird_config/bird/net/unet.conf
2026-05-05 15:48:43 +08:00

97 lines
2.3 KiB
Plaintext

# 公网处理 => inet4/6
protocol pipe unet4_inet4_sync {
table unet4;
peer table t102v4;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
if is_bogon_prefix() then reject;
bgp_path.empty;
bgp_community.empty;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,10,10204));
krt_prefsrc = LOCAL_V4_kernel;
accept;
};
import none;
}
protocol pipe unet6_inet6_sync {
table unet6;
peer table t102v6;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
if is_bogon_prefix() then reject;
bgp_path.empty;
bgp_community.empty;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,10,10206));
krt_prefsrc = LOCAL_V6_kernel;
accept;
};
import none;
}
# DN42处理 => dn42v4/6
protocol pipe unet4_dn42v4_sync {
table unet4;
peer table t102v4;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
if !is_dn42_prefix() then reject;
bgp_path.empty;
bgp_community.empty;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,10,10204));
krt_prefsrc = DN42_V4_kernel;
accept;
};
import none;
}
protocol pipe unet6_dn42v6_sync {
table unet6;
peer table t102v6;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
if !is_dn42_prefix() then reject;
bgp_path.empty;
bgp_community.empty;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,10,10206));
krt_prefsrc = DN42_V6_kernel;
accept;
};
import none;
}
# 剩下的进入master (只有V4)
protocol pipe unet4_sync {
table unet4;
peer table master4;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
if !unet_is_valid_network_v4() then reject;
bgp_community.empty;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,10,4));
krt_prefsrc = UNET_V4_kernel;
accept;
};
import none;
}
protocol pipe unet4_syncto_inet4 {
table unet4;
peer table t102v4;
export filter {
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
bgp_community.empty;
bgp_large_community.empty;
bgp_large_community.add((UNET_ASN,10,10204));
krt_prefsrc = UNET_V4_kernel;
accept;
};
import none;
}