fix: server address cannot be network address
This commit is contained in:
parent
2a6e6a1e24
commit
61f229b5df
3 changed files with 7 additions and 2 deletions
|
|
@ -9,9 +9,11 @@ echo $WIREGUARD_SERVER_PUBLIC_KEY > /opt/amnezia/wireguard/wireguard_server_publ
|
|||
WIREGUARD_PSK=$(wg genpsk)
|
||||
echo $WIREGUARD_PSK > /opt/amnezia/wireguard/wireguard_psk.key
|
||||
|
||||
WIREGUARD_SERVER_IP=$(echo $WIREGUARD_SUBNET_IP | sed 's/\.0$/\.1/')
|
||||
|
||||
cat > /opt/amnezia/wireguard/wg0.conf <<EOF
|
||||
[Interface]
|
||||
PrivateKey = $WIREGUARD_SERVER_PRIVATE_KEY
|
||||
Address = $WIREGUARD_SUBNET_IP/$WIREGUARD_SUBNET_CIDR
|
||||
Address = $WIREGUARD_SERVER_IP/$WIREGUARD_SUBNET_CIDR
|
||||
ListenPort = $WIREGUARD_SERVER_PORT
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue