Set up an L2TP/IPsec and IKEv2 VPN server on Ubuntu 22.04 using the hw5ds2/setup-ipsec-vpn scripts. Follow this comprehensive guide to configure a secure VPN server for flexible and encrypted connections on EDIS Global VPS.
curl
and wget
, which are necessary for downloading scripts and files.
VPN_DNS_SRV1
and VPN_DNS_SRV2
set the DNS servers for VPN clients.
x.x.x.x
with your server’s public IP address. The script outputs important VPN credentials—keep them secure.
addvpnuser.sh
allows you to add new VPN users with specified usernames and passwords.
'newusername'
and 'newpassword'
with the desired credentials.
delvpnuser.sh
allows you to remove VPN users by specifying their username.
'username_to_remove'
with the username you wish to delete.
My L2TP VPN
).
Your VPN Server IP
).
Your VPN Username
).
Your VPN Password
).
Your VPN IPsec PSK
).
aes128-sha1-modp2048
.
aes128-sha1
.
vpnclient.p12
: Contains the client certificate and private key.
vpnclient.mobileconfig
: Configuration profile for macOS/iOS (not needed for Linux).
vpnclient.sswan
: StrongSwan configuration file (optional).
Your_VPN_Server_IP
with your VPN server’s IP address.
.p12
file.
ca.cer
: The CA certificate.
client.cer
: Your client certificate.
client.key
: Your private key.
My IKEv2 VPN
).Your VPN Server IP
).
ca.cer
file you extracted earlier.
client.cer
file.
client.key
file.
aes128gcm16
.
/var/log/syslog
or use journalctl -xe
.