146 lines
3.6 KiB
Plaintext
146 lines
3.6 KiB
Plaintext
filter filter_inet4_bgp_import {
|
|
if is_self_net_inet4() then reject;
|
|
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
|
|
bgp_large_community.empty;
|
|
bgp_large_community.add((LOCAL_ASN,200,0));
|
|
accept;
|
|
}
|
|
|
|
filter filter_inet4_bgp_export {
|
|
if !is_self_net_inet4() then reject;
|
|
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 reject;
|
|
bgp_large_community.empty;
|
|
accept;
|
|
}
|
|
|
|
filter filter_inet6_bgp_import {
|
|
if is_self_net_inet6() then reject;
|
|
if is_bogon_prefix() || (bgp_path.len > 100) then reject;
|
|
bgp_large_community.empty;
|
|
bgp_large_community.add((LOCAL_ASN,200,0));# 传输到Ebgp
|
|
accept;
|
|
}
|
|
|
|
filter filter_inet6_bgp_export {
|
|
if !is_self_net_inet6() then reject;
|
|
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 reject;
|
|
bgp_large_community.empty;
|
|
accept;
|
|
}
|
|
|
|
filter filter_inet4_ibgp_import {
|
|
if is_self_net_inet4() then reject;
|
|
if is_bogon_prefix() then reject;
|
|
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
|
accept;
|
|
}
|
|
|
|
filter filter_inet4_ibgp_export {
|
|
if is_self_net_inet4() then reject;
|
|
if is_bogon_prefix() then reject;
|
|
if bgp_large_community ~ [(LOCAL_ASN, 1,*)] then reject;
|
|
accept;
|
|
}
|
|
|
|
filter filter_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;
|
|
accept;
|
|
}
|
|
|
|
filter filter_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;
|
|
accept;
|
|
}
|
|
|
|
|
|
template bgp tpl_inet_up {
|
|
graceful restart;
|
|
local as LOCAL_ASN;
|
|
ipv4 {
|
|
table inet4;
|
|
import filter filter_inet4_bgp_import;
|
|
export filter filter_inet4_bgp_export;
|
|
};
|
|
ipv6 {
|
|
table inet6;
|
|
import filter filter_inet6_bgp_import;
|
|
export filter filter_inet6_bgp_export;
|
|
};
|
|
}
|
|
|
|
template bgp tpl_inet4_up {
|
|
graceful restart;
|
|
local as LOCAL_ASN;
|
|
ipv4 {
|
|
table inet4;
|
|
import filter filter_inet4_bgp_import;
|
|
export filter filter_inet4_bgp_export;
|
|
};
|
|
}
|
|
|
|
template bgp tpl_inet6_up {
|
|
graceful restart;
|
|
local as LOCAL_ASN;
|
|
ipv6 {
|
|
table inet6;
|
|
import filter filter_inet6_bgp_import;
|
|
export filter filter_inet6_bgp_export;
|
|
};
|
|
}
|
|
|
|
template bgp tpl_inet_ibgp {
|
|
graceful restart;
|
|
local as LOCAL_ASN;
|
|
med metric;
|
|
direct;
|
|
ipv4 {
|
|
table inet4;
|
|
next hop self;
|
|
gateway direct;
|
|
import filter filter_inet4_ibgp_import;
|
|
export filter filter_inet4_ibgp_export;
|
|
};
|
|
ipv6 {
|
|
table inet6;
|
|
next hop self;
|
|
gateway direct;
|
|
import filter filter_inet6_ibgp_import;
|
|
export filter filter_inet6_ibgp_export;
|
|
};
|
|
}
|
|
|
|
template bgp tpl_inet4_ibgp {
|
|
graceful restart;
|
|
local as LOCAL_ASN;
|
|
med metric;
|
|
direct;
|
|
ipv4 {
|
|
table inet4;
|
|
next hop self;
|
|
gateway direct;
|
|
import filter filter_inet4_ibgp_import;
|
|
export filter filter_inet4_ibgp_export;
|
|
};
|
|
}
|
|
|
|
template bgp tpl_inet6_ibgp {
|
|
graceful restart;
|
|
local as LOCAL_ASN;
|
|
med metric;
|
|
direct;
|
|
ipv6 {
|
|
table inet6;
|
|
next hop self;
|
|
gateway direct;
|
|
import filter filter_inet6_ibgp_import;
|
|
export filter filter_inet6_ibgp_export;
|
|
};
|
|
} |