From 3c010e2c5f39d1dbfedd3f84edecfbffd007d122 Mon Sep 17 00:00:00 2001 From: Julian Labus Date: Sat, 4 May 2019 19:53:34 +0200 Subject: [PATCH] Role service-yanic: use wireguard interfaces for respondd on servers --- roles/service-yanic/meta/main.yml | 3 ++- roles/service-yanic/templates/respondd.conf.j2 | 13 ++++++++++--- roles/service-yanic/templates/yanic.conf.j2 | 8 ++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/roles/service-yanic/meta/main.yml b/roles/service-yanic/meta/main.yml index cd0b89c..f6d0424 100644 --- a/roles/service-yanic/meta/main.yml +++ b/roles/service-yanic/meta/main.yml @@ -1,3 +1,4 @@ --- dependencies: -# - { role: golang } + - { role: golang } + - { role: wireguard } diff --git a/roles/service-yanic/templates/respondd.conf.j2 b/roles/service-yanic/templates/respondd.conf.j2 index 5105992..d9ff3a9 100644 --- a/roles/service-yanic/templates/respondd.conf.j2 +++ b/roles/service-yanic/templates/respondd.conf.j2 @@ -1,11 +1,18 @@ data_interval = "1m" -batman = [ {% for mesh in meshes %}"{{mesh.id}}bat"{% if not loop.last %}, {% endif %}{% endfor %}] +batman = [ {% for mesh in meshes %}"{{mesh.id}}bat"{% if not loop.last %}, {% endif %}{% endfor %} ] +{% if server_type == 'monitoring' %} [[listen]] -address = "ff05::2:1001" -interface = "dom0br" +address = "ff02::2:1001" +interface = "loopback" port = 1001 +{% else %} +[[listen]] +address = "ff02::2:1001" +interface = "wg-suesskartof" +port = 1001 +{% endif%} {% for mesh in meshes %} {% if server_type == 'gateway' %} {% for instance in mesh.fastd.nodes.instances %} diff --git a/roles/service-yanic/templates/yanic.conf.j2 b/roles/service-yanic/templates/yanic.conf.j2 index d9ecb4e..3b060c2 100644 --- a/roles/service-yanic/templates/yanic.conf.j2 +++ b/roles/service-yanic/templates/yanic.conf.j2 @@ -22,6 +22,14 @@ domains = [ {% endfor %} ] +[[respondd.interfaces]] +ifname = "loopback" +multicast_address = "ff02::2:1001" +{% for network in my_wireguard_networks %} +[[respondd.interfaces]] +ifname = "wg-{{ network.remote[:11] }}" +multicast_address = "ff02::2:1001" +{% endfor %} {% for mesh in meshes %} [[respondd.interfaces]] ifname = "{{mesh.id}}br"