Merge e74d607a52 into 979ab42c5a
This commit is contained in:
commit
81ca956ba9
3 changed files with 11 additions and 2 deletions
|
|
@ -124,6 +124,7 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon
|
|||
.toObject()
|
||||
.value(config_key::subnet_address)
|
||||
.toString(protocols::wireguard::defaultSubnetAddress));
|
||||
lastIp.setAddress(lastIp.toIPv4Address() + 1);
|
||||
} else {
|
||||
lastIp = ips.last();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,14 @@ echo $WIREGUARD_SERVER_PUBLIC_KEY > /opt/amnezia/awg/wireguard_server_public_key
|
|||
WIREGUARD_PSK=$(wg genpsk)
|
||||
echo $WIREGUARD_PSK > /opt/amnezia/awg/wireguard_psk.key
|
||||
|
||||
IFS='.' read -r a b c d <<< "$WIREGUARD_SUBNET_IP"
|
||||
((d++))
|
||||
WIREGUARD_SERVER_IP="${a}.${b}.${c}.${d}"
|
||||
|
||||
cat > /opt/amnezia/awg/wg0.conf <<EOF
|
||||
[Interface]
|
||||
PrivateKey = $WIREGUARD_SERVER_PRIVATE_KEY
|
||||
Address = $AWG_SUBNET_IP/$WIREGUARD_SUBNET_CIDR
|
||||
Address = $AWG_SERVER_IP/$WIREGUARD_SUBNET_CIDR
|
||||
ListenPort = $AWG_SERVER_PORT
|
||||
Jc = $JUNK_PACKET_COUNT
|
||||
Jmin = $JUNK_PACKET_MIN_SIZE
|
||||
|
|
|
|||
|
|
@ -9,9 +9,13 @@ echo $WIREGUARD_SERVER_PUBLIC_KEY > /opt/amnezia/wireguard/wireguard_server_publ
|
|||
WIREGUARD_PSK=$(wg genpsk)
|
||||
echo $WIREGUARD_PSK > /opt/amnezia/wireguard/wireguard_psk.key
|
||||
|
||||
IFS='.' read -r a b c d <<< "$WIREGUARD_SUBNET_IP"
|
||||
((d++))
|
||||
WIREGUARD_SERVER_IP="${a}.${b}.${c}.${d}"
|
||||
|
||||
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