hwdsl2 / setup-ipsec-vpn

Scripts to build your own IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
Other
25.29k stars 6.32k forks source link

L2TP/IPSec VPN on Ubuntu #1585

Closed CharkiAbdelillah closed 3 months ago

CharkiAbdelillah commented 3 months ago

pls help me im facing a real issue for 4 days so i want to set up VPN for my client and im using AWS first i faced some issues even following the steps then i tested the setup of L2TP locally using Virtualbox and it worked with me with Ubuntu 20 so i thought the issue was with Ubuntu version from AWS bcs they dont have ubuntun20 ,that's why i exported this vm and imported to aws AMI and it didn't work even the same config works with me in Virtualbox but in AWS didn't pls help me and the logs i got from VPN server ec2 when I'm trying to connect Capture and from the client, i see this like : network connection between your computer and the VPN server could not be established because the remote server is not responding. This could be because one of the network devices (e.g, firewalls, NAT, routers, etc) between your computer and the remote server..... even in aws ec2 i opened all ports

hwdsl2 commented 3 months ago

@CharkiAbdelillah Hello! The logs in your screenshot are not from Libreswan (which this project uses), it looks like they are from strongSwan. If these are the logs from your VPN server, you may have multiple VPN software installed, which could create a conflict.

I would suggest that you install the VPN on a new AWS EC2 instance. Instead of importing your own AMI, you can use any of Ubuntu 24.04/22.04/20.04 provided by AWS. The ports you need to open in the new instance's security group are: UDP ports 500 and 4500 for the VPN, and TCP port 22 for SSH.

For the error on the Windows client, please follow these instructions to resolve: IKEv1 troubleshooting - Windows error 809. Finally, IKEv2 mode is recommended over IPsec/L2TP mode, you can consider using IKEv2 mode instead.

CharkiAbdelillah commented 3 months ago

pls my purpose is to install VPN server on my ec2 then the clients will connect to it using a username and password That is all or also psk so i will create new ec2 ubuntu 22 so pls tell me what i need to follow and whats the best type of VPN gonna work with me in this case