Clone or download

  • Download the latest version as a ZIP or tarball
  • Clone with: git clone https://elmord.org/code/vpnsetup-l2tp

vpnsetup-l2tp: A script to set up an L2TP VPN client on Debian/Ubuntu systems

vpnsetup-l2tp.sh is a script to set up an L2TP VPN client on Debian/Ubuntu systems. It:

  • Asks interactively for the remote VPN address and secret key, login user and password;
  • Downloads, compiles and installs necessary dependencies;
  • Generates config files for openswan and xl2tp;
  • Installs a vpn script, which can be called like sudo vpn up and sudo vpn down to start and stop the VPN.


  • Add a mechanism to add/remove subnets from the VPN. Currently it has a hardcoded subnet, though other subnets can be added non-permanently with ip route add x.x.x.x/xx dev ppp0.


Copyright © 2018-2019 Vítor Bujés Ubatuba De Araújo

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.