bundles/wireguard: add netdev and network files, add iptables rules
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
e2490df48e
commit
58ca3fa9ae
8 changed files with 168 additions and 8 deletions
24
bundles/wireguard/files/wg0.netdev
Normal file
24
bundles/wireguard/files/wg0.netdev
Normal file
|
@ -0,0 +1,24 @@
|
|||
[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
|
Loading…
Add table
Add a link
Reference in a new issue