mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
The hub listens and a spoke dials its hub, as before. In a full mesh every member listens on the mesh port and keeps every peer alive.
20 lines
581 B
Django/Jinja
20 lines
581 B
Django/Jinja
[Interface]
|
|
Address = {{ mesh.address }}/{{ mesh.subnet.split('/')[1] }}
|
|
PrivateKey = {{ WIREGUARD_PRIVATE_KEY }}
|
|
MTU = {{ wireguard_mtu | int }}
|
|
{% if mesh | mesh_listens %}
|
|
ListenPort = {{ mesh.listen_port | int }}
|
|
{% endif %}
|
|
|
|
{% set dialled = mesh | mesh_dialled_peers | map(attribute='host') | list %}
|
|
{% for peer in mesh.peers %}
|
|
[Peer]
|
|
PublicKey = {{ peer.public_key }}
|
|
AllowedIPs = {{ peer.allowed_ips }}
|
|
{% if peer.host in dialled %}
|
|
Endpoint = {{ peer.endpoint | default(peer.host, true) }}:{{ mesh.listen_port | int }}
|
|
PersistentKeepalive = 25
|
|
{% endif %}
|
|
|
|
{% endfor %}
|