26 lines
809 B
Plaintext
26 lines
809 B
Plaintext
[Interface]
|
|
PrivateKey = {{ wireguard_clients['matrix']['privkey'] }}
|
|
Address = {{ wireguard_vpn_network | ipsubnet(32, client.offset) }}
|
|
|
|
[Peer]
|
|
PublicKey = {{ wireguard_server_pubkey }}
|
|
Endpoint = vpn.awful.club:51820
|
|
AllowedIPs = 0.0.0.0/0
|
|
|
|
{% for client in wireguard_clients %}
|
|
[Peer]
|
|
# {{ client.name }}
|
|
PublicKey = {{ client.pubkey }}
|
|
{#
|
|
We want the Address field here to be an IP address
|
|
withOUT the whole network in CIDR notation, like 10.0.0.15/32.
|
|
|
|
If wireguard_vpn_network is a CIDR network like 10.0.0.0/24,
|
|
and client.offset is an integer like 15,
|
|
this will produce an offset of the start of the network with a /32 CIDR prefix
|
|
which in this case will be the desired 10.0.0.15/32.
|
|
#}
|
|
AllowedIPs = {{ wireguard_vpn_network | ipsubnet(32, client.offset) }}
|
|
|
|
{% endfor %}
|