Files
bird_config/bird/conf/mynet.conf
2025-04-25 12:39:32 +08:00

134 lines
3.2 KiB
Plaintext

function is_self_net() {
return net ~ [
44.32.191.0/24
];
}
protocol static route_int_export_v4 {
route 44.32.191.0/24 reject;
ipv4 {
table inet4;
import filter {
bgp_large_community.add((LOCAL_ASN,3,0));
bgp_large_community.add((LOCAL_ASN,1,0));
bgp_large_community.add((LOCAL_ASN,200,0));
accept;
};
export none;
};
}
function is_self_net_v6() {
return net ~ [
2406:840:e600::/44{44,48},
2a14:7580:9600::/40{40,48}
];
}
protocol static route_int_export_v6 {
route 2406:840:e600::/48 reject;
route 2406:840:e601::/48 reject;
route 2406:840:e608::/46 reject;
route 2a14:7580:9600::/47 reject;
route 2a14:7580:9603::/48 reject;
route 2a14:7580:9604::/48 reject;
ipv6 {
table inet6;
import filter {
bgp_large_community.add((LOCAL_ASN,3,0));
bgp_large_community.add((LOCAL_ASN,1,0));
bgp_large_community.add((LOCAL_ASN,200,0));
accept;
};
export none;
};
}
function dn42_is_self_net() {
return net ~ [
172.20.21.0/26+
];
}
protocol static route_dn42_export_v4 {
route 172.20.21.0/26 reject;
ipv4 {
table dn42v4;
import filter {
bgp_large_community.add((DN42_ASN,3,0));# 不允许导出到内核
bgp_large_community.add((DN42_ASN,1,0));# 不允许传输到ibgp
bgp_large_community.add((DN42_ASN,200,0));# 传输到Ebgp
accept;
};
export none;
};
}
function dn42_is_self_net_v6() {
return net ~ [
fde8:936e:ee29::/48+
];
}
protocol static route_dn42_export_v6 {
route fde8:936e:ee29::/48 reject;
ipv6 {
table dn42v6;
import filter {
bgp_large_community.add((DN42_ASN,3,0));# 不允许导出到内核
bgp_large_community.add((DN42_ASN,1,0));# 不允许传输到ibgp
bgp_large_community.add((DN42_ASN,200,0));# 传输到Ebgp
accept;
};
export none;
};
}
function unet_is_self_net() {
return net ~ [
10.188.2.0/23+,
10.188.11.0/24,
172.20.21.0/29
];
}
protocol static route_unet_export_v4 {
route 10.188.2.0/23 reject;
route 10.188.11.0/24 reject;
route 172.20.21.0/29 reject;
ipv4 {
table unet4;
import filter {
bgp_large_community.add((UNET_ASN,3,0));# 不允许导出到内核
bgp_large_community.add((UNET_ASN,1,0));# 不允许传输到ibgp
bgp_large_community.add((UNET_ASN,200,0));# 传输到Ebgp
accept;
};
export none;
};
}
function unet_is_self_net_v6() {
return net ~ [
2406:840:e601::/48{48,56},
fde8:936e:ee29:1000::/56
];
}
protocol static route_unet_export_v6 {
route 2406:840:e601::/48 reject;
route fde8:936e:ee29:1000::/56 reject;
ipv6 {
table unet6;
import filter {
bgp_large_community.add((UNET_ASN,3,0));# 不允许导出到内核
bgp_large_community.add((UNET_ASN,1,0));# 不允许传输到ibgp
bgp_large_community.add((UNET_ASN,200,0));# 传输到Ebgp
accept;
};
export none;
};
}