# Requirements apt-get -y update && apt-get -y upgrade apt-get -y install strongswan xl2tpd libstrongswan-standard-plugins libstrongswan-extra-plugins VPN_SERVER_IP='' VPN_IPSEC_PSK='' VPN_USER='' VPN_PASSWORD='' cat > /etc/ipsec.conf < /etc/ipsec.secrets < /etc/xl2tpd/xl2tpd.conf < /etc/ppp/options.l2tpd.client < /usr/local/bin/start-vpn < /var/run/xl2tpd/l2tp-control sleep 5 #ip route add 10.0.0.0/24 dev ppp0 ) EOF chmod +x /usr/local/bin/start-vpn cat > /usr/local/bin/stop-vpn < /var/run/xl2tpd/l2tp-control ipsec down myvpn) && ( service xl2tpd stop ; service strongswan stop) EOF chmod +x /usr/local/bin/stop-vpn echo "To start VPN type: start-vpn" echo "To stop VPN type: stop-vpn"