Files
bird_config/bird/template/dn42.conf
2026-01-28 12:37:15 +08:00

78 lines
2.2 KiB
Plaintext

template bgp dn42_bgp_up {
graceful restart;
local as DN42_ASN;
ipv4 {
table dn42v4;
import filter {
if !is_dn42_prefix() then reject;
if is_dn42_self_net() then reject;
bgp_large_community.add((DN42_ASN,200,0));# 传输到Ebgp
accept;
};
export filter {
if !is_dn42_prefix() then reject;
if source !~ [RTS_STATIC, RTS_BGP] then reject;
if bgp_large_community !~ [(DN42_ASN, 200,0)] then reject;
accept;
};
import limit 9000 action block;
};
ipv6 {
table dn42v6;
import filter {
if !is_dn42_prefix() then reject;
if is_dn42_self_net() then reject;
bgp_large_community.add((DN42_ASN,200,0));# 传输到Ebgp
accept;
};
export filter {
if !is_dn42_prefix() then reject;
if source !~ [RTS_STATIC, RTS_BGP] then reject;
if bgp_large_community !~ [(DN42_ASN, 200,0)] then reject;
accept;
};
import limit 9000 action block;
};
}
template bgp dn42_ibgp {
graceful restart;
local as DN42_ASN;
med metric;
direct;
ipv4 {
table dn42v4;
next hop self;
gateway direct;
import filter {
if bgp_large_community ~ [(DN42_ASN, 1,*)] then reject;
if !is_dn42_prefix() then reject;
if is_dn42_self_net() then reject;
accept;
};
export filter {
if bgp_large_community ~ [(DN42_ASN, 1,*)] then reject;
if !is_dn42_prefix() then reject;
if is_dn42_self_net() then reject;
accept;
};
};
ipv6 {
table dn42v6;
next hop self;
gateway direct;
import filter {
if bgp_large_community ~ [(DN42_ASN, 1,*)] then reject;
if !is_dn42_prefix() then reject;
if is_dn42_self_net() then reject;
accept;
};
export filter {
if bgp_large_community ~ [(DN42_ASN, 1,*)] then reject;
if !is_dn42_prefix() then reject;
if is_dn42_self_net() then reject;
accept;
};
};
}