From 26bd85279c6ebd3aab7f33af96af698f7c8cc61e Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Mon, 27 Sep 2021 18:14:18 +0200 Subject: [PATCH] interfaces: mesh_wg: fix for use with bullseye --- roles/interfaces/templates/mesh.conf.j2 | 12 ++++++------ roles/mesh_wg/tasks/main.yml | 16 +++------------- roles/mesh_wg/templates/mesh_wg.conf.j2 | 4 ++-- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/roles/interfaces/templates/mesh.conf.j2 b/roles/interfaces/templates/mesh.conf.j2 index 7f2e962..5358b26 100644 --- a/roles/interfaces/templates/mesh.conf.j2 +++ b/roles/interfaces/templates/mesh.conf.j2 @@ -14,6 +14,8 @@ iface br-{{ site_code }} {% if global_ipv6 is defined %} address {{ global_ipv6 }} {% endif %} + # + post-up echo 2 > /sys/class/net/bat-{{ site_code }}/brport/multicast_router # bat-{{ site_code }} auto bat-{{ site_code }} @@ -21,16 +23,14 @@ iface bat-{{ site_code }} hwaddress f2:00:90:00:{{ gateway_id }}:20 mtu 1500 # - batman-hop-penalty 5 batman-ifaces dmy-{{ site_code }} batman-ifaces-ignore-regex .*_.* - batman-multicast-mode disabled batman-routing-algo {{ batman_algo }} # - # batman-gw-mode option seems non reliable - post-up /usr/sbin/batctl -m bat-{{ site_code }} it 5000 - post-up /usr/sbin/batctl -m bat-{{ site_code }} gw server - post-up echo 2 > /sys/class/net/bat-{{ site_code }}/brport/multicast_router + post-up /usr/sbin/batctl meshif bat-{{ site_code }} gw server + post-up /usr/sbin/batctl meshif bat-{{ site_code }} hp 5 + post-up /usr/sbin/batctl meshif bat-{{ site_code }} it 5000 + post-up /usr/sbin/batctl meshif bat-{{ site_code }} mff 1 # dmy-{{ site_code }} diff --git a/roles/mesh_wg/tasks/main.yml b/roles/mesh_wg/tasks/main.yml index d1d27eb..0e5e985 100644 --- a/roles/mesh_wg/tasks/main.yml +++ b/roles/mesh_wg/tasks/main.yml @@ -1,17 +1,7 @@ --- -- name: Enable backports - apt_repository: repo='deb http://deb.debian.org/debian buster-backports main' - -- name: Install kernel headers - apt: name=linux-headers-amd64 - -- name: Install wireguard from backports - apt: - name: - - wireguard-dkms - - wireguard-tools - default_release: buster-backports +- name: Install wireguard + apt: name=wireguard-tools - name: Create wireguard config directory file: @@ -28,7 +18,7 @@ notify: Reload interfaces - name: Install wgskex - apt: deb=http://moepman.eu/tmp/wgskex_0.1.0_amd64.deb + apt: deb=http://moepman.eu/tmp/wgskex_0.3.1-1-g8f8ef54_amd64.deb - name: Install ping endpoint copy: src=ping dest=/var/www/html/ping diff --git a/roles/mesh_wg/templates/mesh_wg.conf.j2 b/roles/mesh_wg/templates/mesh_wg.conf.j2 index 8482b3d..084afcd 100644 --- a/roles/mesh_wg/templates/mesh_wg.conf.j2 +++ b/roles/mesh_wg/templates/mesh_wg.conf.j2 @@ -3,11 +3,11 @@ # vx-{{ site_code }} auto vx-{{ site_code }} iface vx-{{ site_code }} + mtu 1350 vxlan-physdev wg-{{ site_code }} pre-up ip -6 link add vx-{{ site_code }} type vxlan id {{ vx_wg_vni }} local fe80::{{ gateway_id }} dev wg-{{ site_code }} noudpcsum dstport 8472 up ip link set vx-{{ site_code }} up - post-up ip link set vx-{{ site_code }} mtu 1350 - post-up batctl -m bat-{{ site_code }} if add vx-{{ site_code }} + post-up batctl meshif bat-{{ site_code }} if add vx-{{ site_code }} down ip link set vx-{{ site_code }} down post-down ip -6 link del vx-{{ site_code }}