mirror of
https://git.burble.com/burble.dn42/grc.git
synced 2024-05-12 03:55:05 +00:00
Add templates for exporting collector BGP feeds
This commit is contained in:
@ -51,7 +51,7 @@ function rc_peer_import6(int peer_as; int peer_ref)
|
|||||||
{
|
{
|
||||||
# accept valid networks
|
# accept valid networks
|
||||||
if net ~ [
|
if net ~ [
|
||||||
fd00::/8+
|
fd00::/8{44,64}
|
||||||
] then {
|
] then {
|
||||||
|
|
||||||
bgp_large_community.add(( GRC_AS, peer_as, peer_ref ));
|
bgp_large_community.add(( GRC_AS, peer_as, peer_ref ));
|
||||||
@ -76,7 +76,7 @@ template bgp RC_PEER4 {
|
|||||||
import keep filtered;
|
import keep filtered;
|
||||||
import limit 10000 action block;
|
import limit 10000 action block;
|
||||||
|
|
||||||
# accept multiple routes for same destination
|
# accept multiple routes for same desgination
|
||||||
add paths rx;
|
add paths rx;
|
||||||
|
|
||||||
# don't export anything
|
# don't export anything
|
||||||
@ -96,7 +96,7 @@ template bgp RC_PEER6 {
|
|||||||
import keep filtered;
|
import keep filtered;
|
||||||
import limit 10000 action block;
|
import limit 10000 action block;
|
||||||
|
|
||||||
# accept multiple routes for same destination
|
# accept multiple routes for same desgination
|
||||||
add paths rx;
|
add paths rx;
|
||||||
|
|
||||||
# don't export anything
|
# don't export anything
|
||||||
@ -117,7 +117,7 @@ template bgp RC_MULTIPEER {
|
|||||||
import keep filtered;
|
import keep filtered;
|
||||||
import limit 10000 action block;
|
import limit 10000 action block;
|
||||||
|
|
||||||
# accept multiple routes for same destination
|
# accept multiple routes for same desgination
|
||||||
add paths rx;
|
add paths rx;
|
||||||
|
|
||||||
# don't export anything
|
# don't export anything
|
||||||
@ -128,7 +128,7 @@ template bgp RC_MULTIPEER {
|
|||||||
import keep filtered;
|
import keep filtered;
|
||||||
import limit 10000 action block;
|
import limit 10000 action block;
|
||||||
|
|
||||||
# accept multiple routes for same destination
|
# accept multiple routes for same desgination
|
||||||
add paths rx;
|
add paths rx;
|
||||||
|
|
||||||
# don't export anything
|
# don't export anything
|
||||||
@ -137,6 +137,76 @@ template bgp RC_MULTIPEER {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# export templates
|
||||||
|
|
||||||
|
# IPv4 export filter
|
||||||
|
function rc_peer_export4()
|
||||||
|
{
|
||||||
|
if net ~ [
|
||||||
|
172.16.0.0/12+,
|
||||||
|
10.0.0.0/8+
|
||||||
|
] then {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
# IPv6 export filter
|
||||||
|
function rc_peer_export6()
|
||||||
|
{
|
||||||
|
if net ~ [
|
||||||
|
fd00::/8{44,64}
|
||||||
|
] then {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
# IPv4 only peer
|
||||||
|
template bgp RC_EXPORT4 {
|
||||||
|
|
||||||
|
local as GRC_AS;
|
||||||
|
multihop;
|
||||||
|
|
||||||
|
ipv4 {
|
||||||
|
import none;
|
||||||
|
export where rc_peer_export4();
|
||||||
|
add paths tx;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
template bgp RC_EXPORT6 {
|
||||||
|
|
||||||
|
local as GRC_AS;
|
||||||
|
multihop;
|
||||||
|
|
||||||
|
ipv6 {
|
||||||
|
import none;
|
||||||
|
export where rc_peer_export6();
|
||||||
|
add paths tx;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
template bgp RC_EXPORT_MULTI {
|
||||||
|
|
||||||
|
local as GRC_AS;
|
||||||
|
multihop;
|
||||||
|
|
||||||
|
ipv4 {
|
||||||
|
import none;
|
||||||
|
export where rc_peer_export4();
|
||||||
|
add paths tx;
|
||||||
|
};
|
||||||
|
|
||||||
|
ipv6 {
|
||||||
|
import none;
|
||||||
|
export where rc_peer_export6();
|
||||||
|
add paths tx;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# include peer definitions
|
# include peer definitions
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user