From ad3c223385a9aa323227633fcc5e456d1235e873 Mon Sep 17 00:00:00 2001 From: Ola Tuvesson Date: Tue, 22 Aug 2017 00:39:43 +0100 Subject: [PATCH 1/2] Will now set "local" in server.conf to the chosen IP adderess If you want to run OpenVPN in UDP mode on an secondary IP, UDP routing will fail unless you explicitly bind OpenVPN to the chosen IP address. This change includes the "local" parameter in the config and sets it to the IP address entered at the beginning. --- openvpn-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/openvpn-install.sh b/openvpn-install.sh index 429dea5..fdb7aa3 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -427,6 +427,7 @@ WantedBy=multi-user.target" > /etc/systemd/system/rc-local.service chmod 644 /etc/openvpn/crl.pem # Generate server.conf + echo "local $IP" > /etc/openvpn/server.conf echo "port $PORT" > /etc/openvpn/server.conf if [[ "$PROTOCOL" = 'UDP' ]]; then echo "proto udp" >> /etc/openvpn/server.conf From c0ed60e8cfbc8ac36ba6472af88fb1eacc667dee Mon Sep 17 00:00:00 2001 From: Angristan Date: Tue, 22 Aug 2017 11:12:42 +0200 Subject: [PATCH 2/2] Update openvpn-install.sh --- openvpn-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index fdb7aa3..1317865 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -428,7 +428,7 @@ WantedBy=multi-user.target" > /etc/systemd/system/rc-local.service # Generate server.conf echo "local $IP" > /etc/openvpn/server.conf - echo "port $PORT" > /etc/openvpn/server.conf + echo "port $PORT" >> /etc/openvpn/server.conf if [[ "$PROTOCOL" = 'UDP' ]]; then echo "proto udp" >> /etc/openvpn/server.conf elif [[ "$PROTOCOL" = 'TCP' ]]; then