From b0e12b19f8d9359d7675fb458a517e65b38d56d3 Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sun, 4 Sep 2022 07:40:51 +0200 Subject: [PATCH] bird: prevent duplicate rules --- roles/bird/templates/bird.conf.j2 | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/roles/bird/templates/bird.conf.j2 b/roles/bird/templates/bird.conf.j2 index fa187f9..a369d93 100644 --- a/roles/bird/templates/bird.conf.j2 +++ b/roles/bird/templates/bird.conf.j2 @@ -8,25 +8,30 @@ protocol device { scan time 10; } -protocol kernel { +protocol direct { + ipv4; + ipv6; +} + +protocol kernel kernel4 { ipv4 { import all; - export all; + export where source != RTS_DEVICE; }; } -protocol kernel { +protocol kernel kernel6 { ipv6 { import all; - export all; + export where source != RTS_DEVICE; }; } -protocol ospf v2 { +protocol ospf v2 ospf4 { ipv4 { import all; - export where source = RTS_STATIC; + export where source ~ [ RTS_STATIC, RTS_DEVICE ]; }; area 0 { @@ -50,11 +55,11 @@ protocol ospf v2 { } -protocol ospf v3 { +protocol ospf v3 ospf6 { ipv6 { import all; - export where source = RTS_STATIC; + export where source ~ [ RTS_STATIC, RTS_DEVICE ]; }; area 0 { @@ -81,10 +86,6 @@ protocol ospf v3 { {% if bird__radv_interfaces %} protocol radv { - ipv6 { - export all; - }; - {% for name, iface in bird__radv_interfaces.items() %} interface {{ name | enquote }} { max ra interval {{ bird__radv_max_interval | int }};