q
This commit is contained in:
15
bird/filter/inet_downstream.conf
Normal file
15
bird/filter/inet_downstream.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
# 下游-收表控制器
|
||||
function function_inet6_downstream_import() {
|
||||
if is_bogon_prefix() || (bgp_path.len > 100) then return false;
|
||||
bgp_large_community.add((LOCAL_ASN,200,0));
|
||||
return true;
|
||||
}
|
||||
|
||||
# 下游-发表控制器
|
||||
function function_inet6_downstream_export() {
|
||||
# 过滤掉begon和过长的段子(太长了下游受不了)
|
||||
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
|
||||
# BGP发出底线防控
|
||||
if bgp_large_community !~ [(LOCAL_ASN, 200,0)] then return false;
|
||||
return true;
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
function function_inet4_bgp_import() {
|
||||
if is_self_net_inet4() then return false;
|
||||
if is_self_net() then return false;
|
||||
if is_bogon_prefix() || (bgp_path.len > 100) then return false;
|
||||
bgp_large_community.add((LOCAL_ASN,200,0));
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet4_bgp_export() {
|
||||
if !is_self_net_inet4() then return false;
|
||||
if !is_self_net() then return false;
|
||||
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
|
||||
if source != RTS_STATIC then reject;
|
||||
if bgp_large_community !~ [(LOCAL_ASN, 200,0)] then return false;
|
||||
@@ -14,44 +14,16 @@ function function_inet4_bgp_export() {
|
||||
}
|
||||
|
||||
function function_inet6_bgp_import() {
|
||||
if is_self_net_inet6() then return false;
|
||||
if is_self_net() then return false;
|
||||
if is_bogon_prefix() || (bgp_path.len > 100) then return false;
|
||||
bgp_large_community.add((LOCAL_ASN,200,0));
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet6_bgp_export() {
|
||||
if !is_self_net_inet6() then return false;
|
||||
if !is_self_net() then return false;
|
||||
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
|
||||
if source != RTS_STATIC then reject;
|
||||
if bgp_large_community !~ [(LOCAL_ASN, 200,0)] then return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet4_ibgp_import() {
|
||||
if is_self_net_inet4() then return false;
|
||||
if is_bogon_prefix() then return false;
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet4_ibgp_export() {
|
||||
if is_self_net_inet4() then return false;
|
||||
if is_bogon_prefix() then return false;
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet6_ibgp_import() {
|
||||
if is_self_net_inet6() then reject;
|
||||
if is_bogon_prefix() then reject;
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet6_ibgp_export() {
|
||||
if is_self_net_inet6() then reject;
|
||||
if is_bogon_prefix() then reject;
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
||||
return true;
|
||||
}
|
||||
27
bird/filter/inet_ibgp.conf
Normal file
27
bird/filter/inet_ibgp.conf
Normal file
@@ -0,0 +1,27 @@
|
||||
function function_inet4_ibgp_import() {
|
||||
if is_self_net() then return false;
|
||||
if is_bogon_prefix() then return false;
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet4_ibgp_export() {
|
||||
if is_self_net() then return false;
|
||||
if is_bogon_prefix() then return false;
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet6_ibgp_import() {
|
||||
if is_self_net() then reject;
|
||||
if is_bogon_prefix() then reject;
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
||||
return true;
|
||||
}
|
||||
|
||||
function function_inet6_ibgp_export() {
|
||||
if is_self_net() then reject;
|
||||
if is_bogon_prefix() then reject;
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user