ix-bird-config/bgp4.conf

62 lines
1.4 KiB
Plaintext
Raw Normal View History

template bgp dnpeers {
local as OWNAS;
2018-10-10 16:10:26 +00:00
table T_BGP;
2018-09-12 09:16:29 +00:00
# metric is the number of hops between us and the peer
path metric 1;
2018-09-12 09:16:29 +00:00
import all;
export all;
};
2018-09-14 20:30:58 +00:00
template bgp iBGP_Peer {
local as OWNAS;
2018-10-10 16:10:26 +00:00
hold time 15;
igp table T_OSPF;
2018-09-14 20:30:58 +00:00
path metric on;
import keep filtered;
# import where iBGP_import_peer_policy();
# export where iBGP_export_peer_policy();
import all;
export all;
2018-09-22 13:26:27 +00:00
source address OWNIP_IBGP;
2018-09-14 20:30:58 +00:00
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_roa {
include "/var/lib/bird/bird_roa_dn42.conf";
};
protocol pipe {
2018-09-12 09:16:29 +00:00
table master;
2018-10-10 16:10:26 +00:00
peer table T_BGP;
import filter {
2018-10-06 22:39:50 +00:00
if (roa_check(dn42_roa, 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
# 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;
};
};