2020-01-26 11:59:13 +01:00
|
|
|
[Interface]
|
2020-01-26 22:47:59 +01:00
|
|
|
Address = 10.10.10.1/24, fd10:10:10::1/64
|
2020-01-26 21:17:52 +01:00
|
|
|
ListenPort = 51820
|
2020-01-26 11:59:13 +01:00
|
|
|
# Load keys
|
2021-11-21 14:23:14 +01:00
|
|
|
PostUp = [ -s '/etc/wireguard/%i-privatekey' ] || { umask 077 && wg genkey > '/etc/wireguard/%i-privatekey'; }
|
|
|
|
PostUp = [ -s '/etc/wireguard/%i-publickey' ] || { umask 022 && wg pubkey < '/etc/wireguard/%i-privatekey' > '/etc/wireguard/%i-publickey'; }
|
2020-01-26 11:59:13 +01:00
|
|
|
PostUp = wg set '%i' private-key '/etc/wireguard/%i-privatekey'
|
|
|
|
# Load peers
|
2021-11-21 14:23:14 +01:00
|
|
|
PostUp = [ -e '/etc/wireguard/%i-peers.conf' ] || { umask 022 && touch '/etc/wireguard/%i-peers.conf'; }
|
2020-01-27 20:01:21 +01:00
|
|
|
PostUp = wg addconf '%i' '/etc/wireguard/%i-peers.conf'
|
2020-06-14 19:49:14 +02:00
|
|
|
# Reload nftables
|
|
|
|
PostUp = nft -f /etc/nftables.conf
|