From 799b8f9a7658913096f0ea65f2b8fdd079229643 Mon Sep 17 00:00:00 2001 From: Tony Xu Date: Tue, 6 Sep 2016 23:52:08 +0800 Subject: [PATCH] fix net.ipv4.ip_forward settings If the `/etc/sysctl.conf` contains `net.ipv4.ip_forward_use_pmtu` --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 620f410..7ca4bf2 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -286,8 +286,8 @@ status openvpn-status.log verb 3 crl-verify crl.pem" >> /etc/openvpn/server.conf # Enable net.ipv4.ip_forward for the system - sed -i '/net.ipv4.ip_forward/c\net.ipv4.ip_forward=1' /etc/sysctl.conf - if ! grep -q "net.ipv4.ip_forward" /etc/sysctl.conf; then + sed -i '/\/c\net.ipv4.ip_forward=1' /etc/sysctl.conf + if ! grep -q "\" /etc/sysctl.conf; then echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf fi # Avoid an unneeded reboot