give wireguard clients unique IPs

This commit is contained in:
2026-03-10 17:15:26 +01:00
parent 7548252912
commit 905b6c030f
4 changed files with 11 additions and 4 deletions

7
wg.mk
View File

@@ -20,8 +20,11 @@ wgkeys.rec: wireguard/dmz_public_key
git commit -m"add wireguard key for $(name)"
$(info Remember to git push)
wireguard/dmz.conf: xecut/nimbus/dmz.conf | wireguard/dmz_private_key
sed 's/PRIVATE_KEY/$(shell cat $|)/' $< > $@
wireguard/dmz.conf: wireguard/dmz_bare.conf | wireguard/dmz_private_key
sed 's#PRIVATE_KEY#$(shell cat $|)#' $< > $@
wireguard/dmz_bare.conf: wgkeys.rec | xecut/nimbus/dmz.conf
recsel $< -t $(basename $<) -e 'name = "$(name)"' | recfmt -f $| > $@
###### Wireguard configuration #####

View File

@@ -1,8 +1,12 @@
%rec: wgkeys
%key: id
%type: name,pubkey line
%type: id int
%auto: id
%mandatory: name
+ pubkey
id: 2
name: Malin Freeborn
pubkey: loNnXRalD0ZyOLadSWm31rqOuRfEbgtX9O4/z7eSIho=

View File

@@ -8,5 +8,5 @@ DNS = 9.9.9.9
[Peer]
PublicKey = GH+qA1Au9BraGhNt7Aqp8tdhGVfH8ENnY3VzKhe69XQ=
Endpoint = space.xecut.me:51900
AllowedIPs = 10.0.0.1/24
AllowedIPs = 10.0.0.{{id}}/24

View File

@@ -1,4 +1,4 @@
[Peer]
PublicKey = {{pubkey}}
AllowedIPs = 10.0.0.2/32
AllowedIPs = 10.0.0.{{id}}/32