2018-09-12 06:56:34 +00:00
|
|
|
template bgp dnpeers {
|
|
|
|
local as OWNAS;
|
2018-09-12 09:16:29 +00:00
|
|
|
table T_BGP4;
|
|
|
|
|
2018-09-12 06:56:34 +00:00
|
|
|
# metric is the number of hops between us and the peer
|
|
|
|
path metric 1;
|
2018-09-12 09:16:29 +00:00
|
|
|
|
|
|
|
# this line allows debugging filter rules
|
2018-09-12 06:56:34 +00:00
|
|
|
# filtered routes can be looked up in birdc using the "show route filtered" command
|
2018-09-12 09:16:29 +00:00
|
|
|
import keep filtered on;
|
2018-09-12 06:56:34 +00:00
|
|
|
|
|
|
|
import all;
|
|
|
|
export all;
|
|
|
|
#source address 172.20.170.192;
|
|
|
|
};
|
|
|
|
|
2018-09-14 20:30:58 +00:00
|
|
|
template bgp iBGP_Peer {
|
|
|
|
local as OWNAS;
|
2018-09-15 19:11:05 +00:00
|
|
|
igp table T_OSPF4;
|
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;
|
|
|
|
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-09-12 06:56:34 +00:00
|
|
|
protocol pipe {
|
2018-09-12 09:16:29 +00:00
|
|
|
table master;
|
2018-09-12 06:56:34 +00:00
|
|
|
peer table T_BGP4;
|
|
|
|
import filter {
|
|
|
|
# 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;
|
|
|
|
};
|
|
|
|
};
|