Skip to content

Commit

Permalink
increase priority of sysctl conf file (angristan#750)
Browse files Browse the repository at this point in the history
Prevents GCP cloud platform's default security policy for instances, which uses prefix 60-, from overriding ip_forward. Also future-proofs against any other such default policy.
  • Loading branch information
deargle authored Oct 20, 2020
1 parent 197b7b9 commit 2e193e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openvpn-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -891,9 +891,9 @@ verb 3" >>/etc/openvpn/server.conf
mkdir -p /var/log/openvpn
# Enable routing
echo 'net.ipv4.ip_forward=1' >/etc/sysctl.d/20-openvpn.conf
echo 'net.ipv4.ip_forward=1' >/etc/sysctl.d/99-openvpn.conf
if [[ $IPV6_SUPPORT == 'y' ]]; then
echo 'net.ipv6.conf.all.forwarding=1' >>/etc/sysctl.d/20-openvpn.conf
echo 'net.ipv6.conf.all.forwarding=1' >>/etc/sysctl.d/99-openvpn.conf
fi
# Apply sysctl rules
sysctl --system
Expand Down Expand Up @@ -1266,7 +1266,7 @@ function removeOpenVPN() {
find /root/ -maxdepth 1 -name "*.ovpn" -delete
rm -rf /etc/openvpn
rm -rf /usr/share/doc/openvpn*
rm -f /etc/sysctl.d/20-openvpn.conf
rm -f /etc/sysctl.d/99-openvpn.conf
rm -rf /var/log/openvpn
# Unbound
Expand Down

0 comments on commit 2e193e3

Please sign in to comment.