hwdsl2/setup-ipsec-vpn

Public

Set up your own IPsec VPN server in just a few minutes, with IPsec/L2TP, Cisco IPsec and IKEv2. Supports Ubuntu, Debian, CentOS/RHEL, Alpine Linux and Raspberry Pi OS. Includes client config and management scripts.

  • Stars28.9k+77 tuần này
  • Forks6.5k
  • Watchers649
  • Issues0
  • Ngày tạo07/01/2016
  • Cập nhật gần nhất29/10/2026
  • Ngôn ngữShell
  • Giấy phép—
README.md43.6 KBRaw

English | 简体中文 | 繁體中文 | 日本語 | Русский

IPsec VPN Server Auto Setup Scripts

Build Status GitHub Stars Docker Stars Docker Pulls

Set up your own IPsec VPN server in just a few minutes, with IPsec/L2TP, Cisco IPsec and IKEv2.

An IPsec VPN encrypts your network traffic, so that nobody between you and the VPN server can eavesdrop on your data as it travels via the Internet. This is especially useful when using unsecured networks, e.g. at coffee shops, airports or hotel rooms.

We will use Libreswan as the IPsec server, and xl2tpd as the L2TP provider.

Features:

  • Fully automated IPsec VPN server setup, no user input needed
  • Supports IKEv2 with strong and fast ciphers (e.g. AES-GCM)
  • Generates VPN profiles to auto-configure iOS, macOS and Android devices
  • Supports Windows, macOS, iOS, Android, Chrome OS and Linux as VPN clients
  • Includes helper scripts to manage VPN users and certificates

Also available:

📘 Interested in self-hosted AI? The Self-Hosted AI Builder’s Guide is a practical guide to building, securing, and operating your own private AI stack.

Quick start

Start with a Linux server* running a supported operating system.

Use this one-liner to set up an IPsec VPN server:

wget https://get.vpnsetup.net -O vpn.sh && sudo sh vpn.sh

Your VPN login details will be randomly generated, and displayed when finished.

Tip: Optionally install WireGuard, OpenVPN and/or Headscale on the same server.

See the script in action (terminal recording).

Note: This recording is for demo purposes only. VPN credentials in this recording are NOT valid.

Click here if you are unable to download.

You may also use curl to download:

curl -fsSL https://get.vpnsetup.net -o vpn.sh && sudo sh vpn.sh

Alternative setup URLs:

https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/vpnsetup.sh
https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/vpnsetup.sh

If you are unable to download, open vpnsetup.sh, then click the Raw

Nội dung README thuộc về hwdsl2 và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/hwdsl2/setup-ipsec-vpn