En hızlı yöntem üzerinden ilerleyeceğim https://github.com/hwdsl2/setup-ipsec-vpn/tree/master de süpoer bir proje ile 1-2 tık tıka indirmişler adamlar işi helal olsun diyerek projenin ana kurulum dosyasını indirelim:
Bash
wget https://git.io/vpnsetup -O vpnsetup.sh
Dosyayı çalıştırılabilir yapalım:
Bash
sudo chmod +x vpnsetup.sh
Ve ana kurulum betiğini çalıştıralım:
Bash
sudo sh vpnsetup.sh
Hıza göre git üzerinden bazı dosyalar çekip kuracak merak edenlere ;
————– BU KISMI GEÇEBİLİRSİNİZ —————–
Location: https://raw.githubusercontent.com/hwdsl2/setup-ipsec-vpn/master/vpnsetup.sh [following]
–2025-07-18 18:32:30– https://raw.githubusercontent.com/hwdsl2/setup-ipsec-vpn/master/vpnsetup.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 185.199.111.133, 185.199.108.133, 185.199.110.133, …
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 10531 (10K) [text/plain]
Saving to: ‘vpnsetup.sh’
vpnsetup.sh 100%[=================================================>] 10.28K –.-KB/s in 0s
2025-07-18 18:32:31 (78.4 MB/s) – ‘vpnsetup.sh’ saved [10531/10531]
user@user:/home/user# sudo chmod +x vpnsetup.sh
user@user:/home/user# sudo sh vpnsetup.sh
- wget -t 3 -T 30 -q -O /tmp/vpn.KkPgK/vpn.sh https://raw.githubusercontent.com/hwdsl2/setup-ipsec-vpn/master/vpnsetup_ubuntu.sh
VPN credentials not set by user. Generating random PSK and password…
VPN setup in progress… Please be patient.
Installing packages required for setup…
- apt-get -yqq update
- apt-get -yqq install wget dnsutils openssl iptables iproute2 gawk grep sed net-tools
Trying to auto discover IP of this server…
Installing packages required for the VPN…
- apt-get -yqq install libnss3-dev libnspr4-dev pkg-config libpam0g-dev libcap-ng-dev libcap-ng-utils libselinux1-dev libcurl4-gnutls-dev flex bison gcc make libnss3-tools libevent-dev libsystemd-dev uuid-runtime ppp xl2tpd
Scanning processes…
Scanning candidates…
Scanning linux images…
Installing Fail2Ban to protect SSH…
- apt-get -yqq install fail2ban
Downloading helper scripts…
- ikev2.sh addvpnuser.sh delvpnuser.sh
Downloading Libreswan…
- wget -t 3 -T 30 -q -O libreswan-5.3.tar.gz https://github.com/libreswan/libreswan/archive/v5.3.tar.gz
Compiling and installing Libreswan, please wait…
- make -j3 -s base
^[[3~
- make -s install-base
Creating VPN configuration…
Updating sysctl settings…
Updating IPTables rules…
Enabling services on boot…
Starting services…
————- BURADAN DEVAM ————
================================================

Kurulum tamamlanınca aşağıdaki çıktıyı görmeniz gerekiyor. Eğer gördüyseniz herşey yolundadır.
IPsec VPN server is now ready for use!
Connect to your new VPN with these details:
Server IP: 10.10.10.10
IPsec PSK: dnxcqwcokumayacalismaxv
Username: vpnuser
Password: ZZCXXXCC
Write these down. You’ll need them to connect!
VPN client setup: https://vpnsetup.net/clients
================================================
================================================
IKEv2 setup successful. Details for IKEv2 mode:
VPN server address: xxxxx
VPN client name: vpnclientname
Client configuration is available at:
/user/vpnclient.p12 (for Windows & Linux)
/user/vpnclient.sswan (for Android)
/user/vpnclient.mobileconfig (for iOS & macOS)
bu p12 dosyası windows ve linux üzeridne kolayca bağlanmanız için sswan android mobileconfigde ios için işlerinizi çok kolaylaştırıyor. Bunları vpn bağlantısı yapacağınız makineye alıyorsunuz. Örneği windows üzerinden vereyim.
p12 dosyasını buradan veya buradan ikev2_config_import.cmd dosyasını indirip p12 ile aynı pathe bırakıp admin olarak çalıştırıyorsunuz. cmd dosyası herşeyi alıp import edip size tek tıkla bağlanmaya hazır hale geliyor.
cmd dosyasından şöyle bir çıktı almanız lazım :

IKEv2 configuration successfully imported!
To connect to the VPN, click on the wireless/network icon in your system tray,
select the “IKEv2 VPN IPADRES” VPN entry, and click Connect.
Ardından windows’un Ağ ve İnternet – Vpn alanında aşağıda ki gibi görüp bağlanabileceksiniz.

Mobile bağlantı için ise örneğin android google playden strongSwan VPN programını indirip az önce locale vb aldığınız sswanm dosyasını sağ üstten import edip bağlanmanız yeterli oluyor.