1
0
mirror of https://git.burble.com/burble.dn42/grc.git synced 2024-05-12 03:55:05 +00:00

217 lines
3.5 KiB
Plaintext
Raw Normal View History

##########################################################################
#
# BIRD2 Route Collector Configuration
#
##########################################################################
# route collector AS
2019-01-27 16:14:23 +00:00
define GRC_AS = 4242422602;
# router ID
router id 172.20.129.165;
# logging options
log syslog all;
# enable internal watchdog
watchdog warning 5 s;
watchdog timeout 30 s;
# set timeformat for bird_exporter
timeformat protocol iso long;
##########################################################################
# ignore interface up/down events
protocol device { }
##########################################################################
# import filters
# IPv4 import filter
2019-01-27 16:14:23 +00:00
function rc_peer_import4(int peer_as; int peer_ref)
{
2019-01-27 16:14:23 +00:00
# accept valid networks
if net ~ [
2019-01-27 16:14:23 +00:00
172.16.0.0/12+,
10.0.0.0/8+
] then {
2019-01-27 16:14:23 +00:00
# add a large community to tag where the route was sourced
bgp_large_community.add(( GRC_AS, peer_as, peer_ref ));
return true;
}
# reject anything else
2019-01-27 16:14:23 +00:00
return false;
}
# IPv6 import filter
2019-01-27 16:14:23 +00:00
function rc_peer_import6(int peer_as; int peer_ref)
{
2019-01-27 16:14:23 +00:00
# accept valid networks
if net ~ [
fd00::/8{44,64}
2019-01-27 16:14:23 +00:00
] then {
bgp_large_community.add(( GRC_AS, peer_as, peer_ref ));
return true;
}
# reject anything else
2019-01-27 16:14:23 +00:00
return false;
}
##########################################################################
# peer templates
# IPv4 only peer
template bgp RC_PEER4 {
local as GRC_AS;
multihop;
2019-01-27 16:14:23 +00:00
passive;
ipv4 {
import keep filtered;
import limit 10000 action block;
# accept multiple routes for same desgination
add paths rx;
2019-01-27 16:14:23 +00:00
# don't export anything
export none;
};
}
# IPv6 only peer
template bgp RC_PEER6 {
local as GRC_AS;
multihop;
2019-01-27 16:14:23 +00:00
passive;
ipv6 {
import keep filtered;
import limit 10000 action block;
# accept multiple routes for same desgination
add paths rx;
2019-01-27 16:14:23 +00:00
# don't export anything
export none;
};
}
# Combined multiprotocol peer
template bgp RC_MULTIPEER {
local as GRC_AS;
multihop;
2019-01-27 16:14:23 +00:00
passive;
ipv4 {
import keep filtered;
import limit 10000 action block;
# accept multiple routes for same desgination
add paths rx;
2019-01-27 16:14:23 +00:00
# don't export anything
export none;
};
ipv6 {
import keep filtered;
import limit 10000 action block;
# accept multiple routes for same desgination
add paths rx;
2019-01-27 16:14:23 +00:00
# don't export anything
export none;
};
}
##########################################################################
# 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 "/etc/bird/peers/*.conf";
##########################################################################
# end of file