From 60e88aac72a2200d6d45aff184b0e2fc8b80b154 Mon Sep 17 00:00:00 2001 From: graffen Date: Wed, 12 Sep 2018 06:56:34 +0000 Subject: [PATCH] Move BGP-specific config to separate file --- bgp.conf | 34 ++++++++++++++++++++++++++++++++++ bird.conf | 38 ++------------------------------------ 2 files changed, 36 insertions(+), 36 deletions(-) create mode 100644 bgp.conf diff --git a/bgp.conf b/bgp.conf new file mode 100644 index 0000000..84a898e --- /dev/null +++ b/bgp.conf @@ -0,0 +1,34 @@ +template bgp dnpeers { + local as OWNAS; + # metric is the number of hops between us and the peer + path metric 1; + # this lines allows debugging filter rules + # filtered routes can be looked up in birdc using the "show route filtered" command + + table T_BGP4; + import all; + export all; + import limit 1000 action block; + #source address 172.20.170.192; +}; + +protocol pipe { + 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; + }; +}; + diff --git a/bird.conf b/bird.conf index 8b5fe9c..4f7f34b 100644 --- a/bird.conf +++ b/bird.conf @@ -6,7 +6,7 @@ protocol device { } protocol static { - route 172.20.0.0/14 via 172.20.170.192; +# route 172.20.0.0/14 via 172.20.170.192; route 172.20.170.192/27 reject; import all; export none; @@ -34,39 +34,5 @@ protocol kernel { } include "/etc/bird/ospf.conf"; - -template bgp dnpeers { - local as OWNAS; - # metric is the number of hops between us and the peer - path metric 1; - # this lines allows debugging filter rules - # filtered routes can be looked up in birdc using the "show route filtered" command - - table T_BGP4; - import all; - export all; - import limit 1000 action block; - #source address 172.20.170.192; -}; - -protocol pipe { - 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.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; - }; -}; - +include "/etc/bird/bgp.conf"; include "/etc/bird/peers4/*";