40 lines
915 B
Plaintext
40 lines
915 B
Plaintext
# 公网处理 => inet4/6
|
|
protocol pipe unet4_inet4_sync {
|
|
table unet4;
|
|
peer table inet4;
|
|
export filter {
|
|
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
|
|
if is_bogon_prefix() then {
|
|
if net!~[10.188.0.0/16+] then reject;
|
|
}
|
|
accept;
|
|
};
|
|
import none;
|
|
}
|
|
|
|
protocol pipe unet6_inet6_sync {
|
|
table unet6;
|
|
peer table inet6;
|
|
export filter {
|
|
if bgp_large_community ~ [(UNET_ASN, 3,*)] then reject;
|
|
if is_bogon_prefix() then reject;
|
|
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;
|
|
} |