VPN: Install L2TP/IPsec VPN Server Ubuntu 20.04

From Catatan IBM
Revision as of 08:08, 13 February 2022 by Ibm (talk | contribs)
Jump to navigation Jump to search

Install L2TP/IPsec VPN Server

Untuk memudahkan instalasi dan konfigurasi L2TP/IPsec VPN server kita gunakan script installer vpnsetup.sh dari hwdsl2/setup-ipsec-vpn di GitHub.

wget https://git.io/vpnsetup -O vpnsetup.sh

Jalankan installernya.

sudo sh vpnsetup.sh

Setelah instalasi selesai dan sukses, ditampilkan informasi koneksi ke VPN server.

Server IP: 103.147.32.172
IPsec PSK: pHx69Yr9zhLxpGC
Username: vpnuser
Password: vpnpassword


Install L2TP/IPsec VPN Client

Install L2TP/IPsec VPN client di Ubuntu.

sudo apt install network-manager-l2tp network-manager-l2tp-gnome

Membuat koneksi ke VPN server, klik applet Network Manager->VPN Connections->Configure VPN….

Tab VPN, masukkan

  • Gateway = IP VPN server
  • User name = Username VPN
  • Password = Password VPN. Klik icon sebelah kanan, pilih Store the password only for this user agar bisa memasukkan dan menyimpan password

Klik tombol IPsec Settings….

  • Centang Enable IPsec tunnel to L2TP host
  • Pre-shared key = IPsec PSK

Uji coba koneksi ke VPN server dan cek apakah Public IP sudah berubah ke IP VPN server.

curl ifconfig.co


Menambah User

Download script untuk menambah user add_vpn_user.sh

wget -O add_vpn_user.sh https://raw.githubusercontent.com/hwdsl2/setup-ipsec-vpn/master/extras/add_vpn_user.sh

Jalankan scriptnya disertai dengan username dan password yang mau dibuat.

sh add_vpn_user.sh 'username' 'password'

Untuk Pre-shared key tetap menggunakan IPsec PSK yang sama.