[wireguard] add variables for endpoints

This commit is contained in:
Nico Schottelius 2021-12-31 20:22:37 +01:00
parent 8d4803b888
commit 307761fcc7

View file

@ -41,19 +41,19 @@ for ip in $(seq $start $end); do
addr=$prefix${sep}${ip}/${mask}
addr_nomask=$prefix${sep}${ip}
file="vpn-${addr_nomask}.conf"
file="${addr_nomask}.conf"
echo "Writing ${file} and updating gw.conf"
cat <<EOF > $file
[Interface]
PrivateKey = $privkey
PrivateKey = ${privkey}
ListenPort = 51820
Address = ${addr}
[Peer]
PublicKey = 6BRnQ+dmeFzVCH9RbM1pbJ7u3y3qrl+zUzzYCmC88kE=
Endpoint = vpn-18515529.ungleich.ch:51820
AllowedIPs = $allowed_ips
PublicKey = ${vpnpub}
Endpoint = ${vpngw}
AllowedIPs = ${allowed_ips}
EOF
cat <<EOF >> gw.conf