From f12c0fa68de878b660e4bdcacdbfc80ec9d376f3 Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Sat, 15 Sep 2018 21:09:28 +0200 Subject: [PATCH] Cleaning up --- bgp.conf => bgp4.conf | 2 - bgp6.conf | 1 - bird.conf | 12 ++-- bird6.conf | 89 ++++++----------------------- local4.conf => local4-template.conf | 0 local6.conf => local6-template.conf | 0 ospf.conf => ospf4.conf | 10 +--- ospf6.conf | 3 - 8 files changed, 23 insertions(+), 94 deletions(-) rename bgp.conf => bgp4.conf (97%) rename local4.conf => local4-template.conf (100%) rename local6.conf => local6-template.conf (100%) rename ospf.conf => ospf4.conf (79%) diff --git a/bgp.conf b/bgp4.conf similarity index 97% rename from bgp.conf rename to bgp4.conf index 651c7ad..91f0188 100644 --- a/bgp.conf +++ b/bgp4.conf @@ -34,7 +34,6 @@ template pipe iBGP_Pipe { export all; } - protocol pipe { table master; peer table T_BGP4; @@ -46,7 +45,6 @@ protocol pipe { } reject; }; -# import limit 1000 action block; export filter { # here we export the whole net diff --git a/bgp6.conf b/bgp6.conf index 496e549..df3d9e0 100644 --- a/bgp6.conf +++ b/bgp6.conf @@ -34,7 +34,6 @@ template pipe iBGP_Pipe { export all; } - protocol pipe { table master; peer table T_BGP6; diff --git a/bird.conf b/bird.conf index 3e0aa01..c10e243 100644 --- a/bird.conf +++ b/bird.conf @@ -1,6 +1,6 @@ log syslog { debug, trace, info, remote, warning, error, auth, fatal, bug }; table T_BGP4; -table T_OSPF; +table T_OSPF4; protocol device { scan time 10; @@ -13,17 +13,13 @@ protocol static { } include "/etc/bird/local4.conf"; - -# filter helpers -################# - #include "/etc/bird/filter4.conf"; include "/etc/bird/community_filters.conf"; protocol kernel { scan time 20; metric 64; # Use explicit kernel route metric to avoid collisions - # with non-BIRD routes in the kernel routing table + # with non-BIRD routes in the kernel routing table import keep filtered; import none; export filter { @@ -33,6 +29,6 @@ protocol kernel { }; } -include "/etc/bird/ospf.conf"; -include "/etc/bird/bgp.conf"; +include "/etc/bird/ospf4.conf"; +include "/etc/bird/bgp4.conf"; include "/etc/bird/peers4/*"; diff --git a/bird6.conf b/bird6.conf index c3df896..03f8eac 100644 --- a/bird6.conf +++ b/bird6.conf @@ -1,91 +1,34 @@ +log syslog { debug, trace, info, remote, warning, error, auth, fatal, bug }; table T_BGP6; table T_OSPF6; protocol device { - scan time 10; + scan time 10; } -# local configuration -###################### - -include "/etc/bird/local6.conf"; - -# filter helpers -################# - -#include "/etc/bird/filter6.conf"; -include "/etc/bird/community_filters.conf"; - -protocol kernel { - metric 64; # Use explicit kernel route metric to avoid collisions - # with non-BIRD routes in the kernel routing table - scan time 20; - import none; -# export all; # Actually insert routes into the kernel routing table - export filter { - if source = RTS_STATIC then reject; - krt_prefsrc = OWNIP; - accept; - }; -} - -# static routes -################ - protocol static { route fd62:77fb:94bf::/48 reject; import all; export none; } -template bgp dnpeers { - table T_BGP6; - local as 4242423934; - path metric 1; - import all; - export all; -} - -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; -} - -protocol pipe { - peer table T_BGP6; - 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; - }; +include "/etc/bird/local6.conf"; +#include "/etc/bird/filter6.conf"; +include "/etc/bird/community_filters.conf"; +protocol kernel { + metric 64; # Use explicit kernel route metric to avoid collisions + # with non-BIRD routes in the kernel routing table + scan time 20; + import none; + # export all; # Actually insert routes into the kernel routing table export filter { - # here we export the whole net - if is_valid_network() then { - accept; - } - reject; + if source = RTS_STATIC then reject; + krt_prefsrc = OWNIP; + accept; }; -}; - +} include "/etc/bird/ospf6.conf"; +include "/etc/bird/bgp6.conf"; include "/etc/bird/peers6/*"; diff --git a/local4.conf b/local4-template.conf similarity index 100% rename from local4.conf rename to local4-template.conf diff --git a/local6.conf b/local6-template.conf similarity index 100% rename from local6.conf rename to local6-template.conf diff --git a/ospf.conf b/ospf4.conf similarity index 79% rename from ospf.conf rename to ospf4.conf index 6847c9f..4afc468 100644 --- a/ospf.conf +++ b/ospf4.conf @@ -1,5 +1,5 @@ protocol ospf { - table T_OSPF; + table T_OSPF4; import all; export all; @@ -7,9 +7,6 @@ protocol ospf { interface "wg-ospf-*" { }; - interface "wg-uk-lon1" { - }; - interface "lo" { stub; }; @@ -17,7 +14,7 @@ protocol ospf { } protocol direct { - table T_OSPF; + table T_OSPF4; import where is_self_net(); export none; @@ -31,8 +28,7 @@ filter filter_OSPF { }; protocol pipe { - peer table T_OSPF; + peer table T_OSPF4; import filter filter_OSPF; export none; -# export filter filter_OSPF; } diff --git a/ospf6.conf b/ospf6.conf index abe82a3..4777d74 100644 --- a/ospf6.conf +++ b/ospf6.conf @@ -6,9 +6,6 @@ protocol ospf { area 0 { interface "wg-ospf-*" { }; - - interface "wg-uk-lon1" { - }; interface "lo" { stub;