Przeglądaj źródła

network/interfaces: Add support for Wireguard tunnels

  As we use ifupdown-ng setting up a Wireguard tunnel is easy :)
  The only thing special we have to do is to reactivate addr_gen_mode so Linux
  will generate an IPv6 link-local address which we need for OSPFv3 to work.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 2 lat temu
rodzic
commit
48493bb4b2
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      network/interfaces/interfaces.tmpl

+ 7 - 1
network/interfaces/interfaces.tmpl

@@ -60,6 +60,12 @@ iface {{ interface }}
     {%- endfor %}
 	#
   {%- endfor %}
+  {#- Wireguard tunnel? #}
+  {%- if 'wireguard' in config %}
+	use wireguard
+	up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/addr_gen_mode
+	#
+  {%- endif %}
 
   {#- Configure IP addresses #}
   {%- for prefix in config.get ('prefixes', []) %}
@@ -71,7 +77,7 @@ iface {{ interface }}
     {%- set argument = config.get (keyword) %}
     {%- if argument is none %}
     {%- elif keyword.startswith ("_") %}
-    {%- elif keyword in [ 'auto', 'batman', 'bond', 'bridge', 'driver', 'mac', 'method', 'vlan', 'vxlan', 'desc', 'prefixes', 'status', 'tagged_vlans', 'urpf', 'has_gateway' ] %}
+    {%- elif keyword in [ 'auto', 'batman', 'bond', 'bridge', 'driver', 'mac', 'method', 'vlan', 'vxlan', 'desc', 'prefixes', 'status', 'tagged_vlans', 'urpf', 'has_gateway', 'wireguard' ] %}
     {%- elif argument is string or argument is number %}
 	{{ keyword }} {{ argument }}
     {%- else %}