From 942ba05b0ab894044a4401e3d73660695d59ac90 Mon Sep 17 00:00:00 2001 From: h4775346 Date: Fri, 5 Jul 2024 18:22:00 +0300 Subject: [PATCH] Added a script to install xl2tp server to ubuntu and configure it automatically --- sas4-l2tp-full-installer.sh | 98 +++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sas4-l2tp-full-installer.sh diff --git a/sas4-l2tp-full-installer.sh b/sas4-l2tp-full-installer.sh new file mode 100644 index 0000000..f9b9856 --- /dev/null +++ b/sas4-l2tp-full-installer.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +# Update the system +sudo apt update && sudo apt upgrade -y + +# Install required packages +sudo apt install strongswan xl2tpd -y + +# Configure strongSwan +sudo bash -c 'cat > /etc/ipsec.conf < /etc/ipsec.secrets < /etc/xl2tpd/xl2tpd.conf < /etc/ppp/options.xl2tpd < /etc/ppp/chap-secrets < /etc/iptables.rules" + +# Restart services +sudo systemctl restart strongswan +sudo systemctl restart xl2tpd + +# Verify service status +sudo systemctl status strongswan +sudo systemctl status xl2tpd + +echo "L2TP/IPsec setup is complete." + +curl -sL https://raw.githubusercontent.com/h4775346/l2tp-manager/master/sas4-install.sh | sudo bash +