Skip to content

Commit 61b14cf

Browse files
pktplsFFHener
authored andcommitted
tunspace: sync docs and typing from default config
Same as in freifunk-berlin/falter-packages#468
1 parent 54cd889 commit 61b14cf

File tree

1 file changed

+15
-6
lines changed
  • roles/cfg_openwrt/templates/corerouter/config

1 file changed

+15
-6
lines changed

roles/cfg_openwrt/templates/corerouter/config/tunspace.j2

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,40 @@
55
{% set ifname = uplink['ifname'] if mode == 'direct' else 'br-'+name %}
66

77
config tunspace "tunspace"
8+
# Namespace where the uplink will live.
89
option uplink_netns "{{ name }}"
10+
# Existing interface that we'll use as the uplink.
911
option uplink_ifname "{{ ifname }}"
12+
# How the uplink in the namespace is constructed.
13+
# - bridge: creates a macvlan child in bridge mode, useful for creating multiple uplinks from the same original uplink interface.
14+
# - direct: moves the original uplink interface into the namespace directly, useful for wonky cheap USB sticks with broken drivers.
1015
option uplink_mode "{{ mode }}"
16+
# Our own static uplink IPv4 address in CIDR format. Leave empty to use DHCP.
1117
option uplink_ipv4 "{{ uplink['uplink_ipv4']|default('') }}"
18+
# IPv4 address of the gateway. Required in combination with uplink_ipv4, ignored when using DHCP.
1219
option uplink_gateway "{{ uplink['uplink_gateway']|default('') }}"
20+
# Maintenance consists of checking the uplink, refreshing the DHCP lease, checking the tunnel endpoints, and switching endpoints if neccessary.
1321
option maintenance_interval 60
14-
option debug 0
22+
# Enables detailed output of Tunspace's operations. If disabled, only tunnel endpoint changes are reported.
23+
option debug "0"
1524
{% endfor %}
1625

1726
{% for tunnel in networks | selectattr('role', 'equalto', 'tunnel') %}
1827
config wg-interface
1928
option ifname "{{ tunnel['ifname'] }}"
2029
option ipv6 "fe80::2/64"
2130
option ipv4 "{{ tunnel['prefix'] }}"
22-
option mtu {{ tunnel['mtu'] }}
23-
option port {{ tunnel['wireguard_port'] }}
24-
option disabled 0
31+
option mtu "{{ tunnel['mtu'] }}"
32+
option port "{{ tunnel['wireguard_port'] }}"
33+
option disabled "0"
2534

2635
{% endfor %}
2736

2837
{% for gateway in groups['role_gateway'] | sort %}
2938
config wg-server
3039
option name "{{ gateway }}"
3140
option url "https://{{ hostvars[gateway]['uplink']['ipv4'] | ansible.utils.ipaddr('address') }}/ubus"
32-
option insecure_cert 1
33-
option disabled 0
41+
option insecure_cert "1"
42+
option disabled "0"
3443

3544
{% endfor %}

0 commit comments

Comments
 (0)