2018-09-15 18:52:01 +00:00
|
|
|
template bgp dnpeers {
|
|
|
|
local as OWNAS;
|
|
|
|
table T_BGP6;
|
|
|
|
|
|
|
|
# metric is the number of hops between us and the peer
|
|
|
|
path metric 1;
|
|
|
|
|
|
|
|
# this line allows debugging filter rules
|
|
|
|
# filtered routes can be looked up in birdc using the "show route filtered" command
|
|
|
|
import keep filtered on;
|
|
|
|
|
|
|
|
import all;
|
|
|
|
export all;
|
|
|
|
#source address 172.20.170.192;
|
|
|
|
};
|
|
|
|
|
|
|
|
template bgp iBGP_Peer {
|
|
|
|
local as OWNAS;
|
|
|
|
igp table T_OSPF6;
|
|
|
|
path metric on;
|
|
|
|
import keep filtered;
|
|
|
|
# import where iBGP_import_peer_policy();
|
|
|
|
# export where iBGP_export_peer_policy();
|
|
|
|
import all;
|
|
|
|
export all;
|
|
|
|
source address OWNIP;
|
|
|
|
next hop self;
|
|
|
|
}
|
|
|
|
|
|
|
|
template pipe iBGP_Pipe {
|
|
|
|
# table name will come from peer definition
|
|
|
|
peer table master;
|
|
|
|
import all;
|
|
|
|
export all;
|
|
|
|
}
|
|
|
|
|
2018-10-06 22:39:50 +00:00
|
|
|
roa table dn42_roa6 {
|
|
|
|
include "/var/lib/bird/bird6_roa_dn42.conf";
|
|
|
|
};
|
|
|
|
|
2018-09-15 18:52:01 +00:00
|
|
|
protocol pipe {
|
|
|
|
table master;
|
|
|
|
peer table T_BGP6;
|
|
|
|
import filter {
|
2018-10-06 22:39:50 +00:00
|
|
|
|
|
|
|
if (roa_check(dn42_roa6, net, bgp_path.last) = ROA_INVALID) then {
|
|
|
|
print "[dn42] ROA check failed for ", net, " ASN ", bgp_path.last;
|
|
|
|
reject;
|
|
|
|
}
|
|
|
|
# accept every subnet, except our own advertised subnet
|
2018-09-15 18:52:01 +00:00
|
|
|
# filtering is important, because some guys try to advertise routes like 0.0.0$
|
|
|
|
if is_valid_network() && !is_self_net() then {
|
|
|
|
accept;
|
|
|
|
}
|
|
|
|
reject;
|
|
|
|
};
|
|
|
|
|
|
|
|
export filter {
|
|
|
|
# here we export the whole net
|
|
|
|
if is_valid_network() then {
|
|
|
|
accept;
|
|
|
|
}
|
|
|
|
reject;
|
|
|
|
};
|
|
|
|
};
|