bundlewrap/bundles/wireguard/files/wg0.netdev
mwiegand c867fe5ff0 wip
2021-06-23 23:56:41 +02:00

26 lines
500 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']}
AllowedIPs=0.0.0.0/0
% 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
PersistentKeepalive=30
% endfor