217 lines
3.5 KiB
Plaintext
217 lines
3.5 KiB
Plaintext
##########################################################################
|
|
#
|
|
# BIRD2 Route Collector Configuration
|
|
#
|
|
##########################################################################
|
|
|
|
# route collector AS
|
|
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
|
|
function rc_peer_import4(int peer_as; int peer_ref)
|
|
{
|
|
# accept valid networks
|
|
if net ~ [
|
|
172.16.0.0/12+,
|
|
10.0.0.0/8+
|
|
] then {
|
|
|
|
# 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
|
|
return false;
|
|
}
|
|
|
|
# IPv6 import filter
|
|
function rc_peer_import6(int peer_as; int peer_ref)
|
|
{
|
|
# accept valid networks
|
|
if net ~ [
|
|
fd00::/8{44,64}
|
|
] then {
|
|
|
|
bgp_large_community.add(( GRC_AS, peer_as, peer_ref ));
|
|
return true;
|
|
}
|
|
|
|
# reject anything else
|
|
return false;
|
|
}
|
|
|
|
##########################################################################
|
|
# peer templates
|
|
|
|
# IPv4 only peer
|
|
template bgp RC_PEER4 {
|
|
|
|
local as GRC_AS;
|
|
multihop;
|
|
passive;
|
|
|
|
ipv4 {
|
|
import keep filtered;
|
|
import limit 10000 action block;
|
|
|
|
# accept multiple routes for same desgination
|
|
add paths rx;
|
|
|
|
# don't export anything
|
|
export none;
|
|
};
|
|
|
|
}
|
|
|
|
# IPv6 only peer
|
|
template bgp RC_PEER6 {
|
|
|
|
local as GRC_AS;
|
|
multihop;
|
|
passive;
|
|
|
|
ipv6 {
|
|
import keep filtered;
|
|
import limit 10000 action block;
|
|
|
|
# accept multiple routes for same desgination
|
|
add paths rx;
|
|
|
|
# don't export anything
|
|
export none;
|
|
};
|
|
|
|
}
|
|
|
|
|
|
# Combined multiprotocol peer
|
|
template bgp RC_MULTIPEER {
|
|
|
|
local as GRC_AS;
|
|
multihop;
|
|
passive;
|
|
|
|
ipv4 {
|
|
import keep filtered;
|
|
import limit 10000 action block;
|
|
|
|
# accept multiple routes for same desgination
|
|
add paths rx;
|
|
|
|
# don't export anything
|
|
export none;
|
|
};
|
|
|
|
ipv6 {
|
|
import keep filtered;
|
|
import limit 10000 action block;
|
|
|
|
# accept multiple routes for same desgination
|
|
add paths rx;
|
|
|
|
# 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
|