This commit is contained in:
2026-05-23 17:35:37 +08:00
parent ca4a406afc
commit b903422ec6
8 changed files with 35 additions and 175 deletions

View File

@@ -1,40 +1,24 @@
template bgp dn42_bgp_up {
template bgp dn42_up0_new {
graceful restart;
local as DN42_ASN;
ipv4 {
table dn42v4;
import filter {
if !is_dn42_prefix() then reject;
if is_dn42_self_net() then reject;
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;
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;
import filter {if !function_dn42_bgp_import_from_upstream() then reject; accept; };
export filter {if !function_dn42_bgp_export_to_upstream0() then reject; accept; };
};
}
template bgp dn42_ibgp {
template bgp dn42_up1_new {
graceful restart;
local as DN42_ASN;
ipv4 {
table dn42v4;
import filter {if !function_dn42_bgp_import_from_upstream() then reject; accept; };
export filter {if !function_dn42_bgp_export_to_upstream1() then reject; accept; };
};
}
template bgp dn42_ibgp_new {
graceful restart;
local as DN42_ASN;
med metric;
@@ -43,34 +27,19 @@ template bgp dn42_ibgp {
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;
};
import filter {if !function_dn42_ibgp_import() then reject; accept; };
export filter {if !function_dn42_ibgp_export() 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;
};
}
template bgp dn42_ibgp_mp_new {
graceful restart;
local as DN42_ASN;
med metric;
ipv4 {
table dn42v4;
import filter {if !function_dn42_ibgp_import() then reject; accept; };
export filter {if !function_dn42_ibgp_export() then reject; accept; };
};
}

View File

@@ -1,67 +0,0 @@
template bgp dn42_up0_new {
graceful restart;
local as DN42_ASN;
ipv4 {
table dn42v4;
import filter {if !function_dn42_bgp_import_from_upstream() then reject; accept; };
export filter {if !function_dn42_bgp_export_to_upstream0() then reject; accept; };
};
ipv6 {
table dn42v6;
import filter {if !function_dn42_bgp_import_from_upstream() then reject; accept; };
export filter {if !function_dn42_bgp_export_to_upstream0() then reject; accept; };
};
}
template bgp dn42_up1_new {
graceful restart;
local as DN42_ASN;
ipv4 {
table dn42v4;
import filter {if !function_dn42_bgp_import_from_upstream() then reject; accept; };
export filter {if !function_dn42_bgp_export_to_upstream1() then reject; accept; };
};
ipv6 {
table dn42v6;
import filter {if !function_dn42_bgp_import_from_upstream() then reject; accept; };
export filter {if !function_dn42_bgp_export_to_upstream1() then reject; accept; };
};
}
template bgp dn42_ibgp_new {
graceful restart;
local as DN42_ASN;
med metric;
direct;
ipv4 {
table dn42v4;
next hop self;
gateway direct;
import filter {if !function_dn42_ibgp_import() then reject; accept; };
export filter {if !function_dn42_ibgp_export() then reject; accept; };
};
ipv6 {
table dn42v6;
next hop self;
gateway direct;
import filter {if !function_dn42_ibgp_import() then reject; accept; };
export filter {if !function_dn42_ibgp_export() then reject; accept; };
};
}
template bgp dn42_ibgp_mp_new {
graceful restart;
local as DN42_ASN;
med metric;
ipv4 {
table dn42v4;
import filter {if !function_dn42_ibgp_import() then reject; accept; };
export filter {if !function_dn42_ibgp_export() then reject; accept; };
};
ipv6 {
table dn42v6;
import filter {if !function_dn42_ibgp_import() then reject; accept; };
export filter {if !function_dn42_ibgp_export() then reject; accept; };
};
}