From 43d11fe35a6f22a0a5bfa8a140e044bdff5b9f49 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Thu, 16 Feb 2017 12:28:57 -0600 Subject: [PATCH] Fix xl2tpd on CentOS 7 for Linode - Fix xl2tpd on CentOS 7 for providers such as Linode, where kernel module "l2tp_ppp" is unavailable - Closes: #114 --- vpnsetup_centos.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index b343380..4609093 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -418,6 +418,15 @@ chmod 600 /etc/ipsec.secrets* /etc/ppp/chap-secrets* /etc/ipsec.d/passwd* # Apply new IPTables rules iptables-restore < "$IPT_FILE" +# Fix xl2tpd on CentOS 7 for providers such as Linode, +# where kernel module "l2tp_ppp" is unavailable +if grep -qs "release 7" /etc/redhat-release; then + if ! modprobe -q l2tp_ppp; then + sed -i '/ExecStartPre/s/^/#/' /usr/lib/systemd/system/xl2tpd.service + systemctl daemon-reload + fi +fi + # Restart services modprobe -q pppol2tp mkdir -p /var/run/fail2ban