bundlewrap/bundles/wireguard/files/wg0.netdev
Franziska Kunsmann 58ca3fa9ae
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/wireguard: add netdev and network files, add iptables rules
2020-11-21 15:38:38 +01:00

24 lines
454 B
SYSTEMD

[NetDev]
Name=wg0
Kind=wireguard
Description=WireGuard server
[WireGuard]
PrivateKey=${privatekey}
ListenPort=51820
% for peer, config in sorted(peers.items()):
# Peer ${peer}
[WireGuardPeer]
PublicKey=${config['pubkey']}
% if len(peers) == 1: # FIXME
AllowedIPs=${network}
% else:
AllowedIPs=${','.join(sorted(config['ips']))}
% endif
PresharedKey=${config['psk']}
% if 'endpoint' in config:
Endpoint=${config['endpoint']}
% endif
% endfor