Fix dynamic IP assignment in OpenVPN
This commit is contained in:
parent
c336788346
commit
2b310143d7
@ -61,9 +61,8 @@ if ufw status | grep -q "Status: active"; then
|
|||||||
systemctl restart ufw
|
systemctl restart ufw
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /etc/openvpn/myserver.conf ]; then
|
if [ ! -f /etc/openvpn/myserver.conf ] || [[ " $@ " == *" --force "* ]]; then
|
||||||
tee /etc/openvpn/myserver.conf > /dev/null <<EOL
|
tee /etc/openvpn/myserver.conf > /dev/null <<EOL
|
||||||
|
|
||||||
#public-host $VPN_PUBLIC_HOST
|
#public-host $VPN_PUBLIC_HOST
|
||||||
port $VPN_PUBLIC_PORT
|
port $VPN_PUBLIC_PORT
|
||||||
proto udp
|
proto udp
|
||||||
@ -74,7 +73,7 @@ cert myservername.crt
|
|||||||
key myservername.key
|
key myservername.key
|
||||||
dh dh.pem
|
dh dh.pem
|
||||||
|
|
||||||
server $VPN_SUBNET.0 255.255.255.0
|
server $VPN_SUBNET.0 255.255.255.0 nopool
|
||||||
ifconfig-pool-persist /var/log/openvpn/ipp.txt
|
ifconfig-pool-persist /var/log/openvpn/ipp.txt
|
||||||
client-config-dir /etc/openvpn/ccd
|
client-config-dir /etc/openvpn/ccd
|
||||||
topology subnet
|
topology subnet
|
||||||
@ -155,11 +154,11 @@ persist-key
|
|||||||
cipher AES-256-CBC
|
cipher AES-256-CBC
|
||||||
ncp-ciphers AES-256-GCM:AES-128-GCM
|
ncp-ciphers AES-256-GCM:AES-128-GCM
|
||||||
auth SHA1
|
auth SHA1
|
||||||
# tls-client
|
tls-client
|
||||||
client
|
client
|
||||||
resolv-retry infinite
|
resolv-retry infinite
|
||||||
remote $VPN_PUBLIC_HOST $VPN_PUBLIC_PORT udp
|
remote $VPN_PUBLIC_HOST $VPN_PUBLIC_PORT udp
|
||||||
# remote-cert-tls server
|
remote-cert-tls server
|
||||||
float
|
float
|
||||||
verb 3
|
verb 3
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user