hwdsl2 / setup-ipsec-vpn

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

Can't connect on EC2 with all UDP incoming port enabled #1609

Closed ericxl closed 1 month ago

ericxl commented 1 month ago

Thanks for the repo! I launched a EC2 Ubuntu instance with all UDP ports enabled, but can't connect. I tried both IKEv2 and Wireguard but with no luck.

WIth IKEv2, on both iOS and macOS it is stuck at "connecting" forever, with Wireguard, it is connected but no internet

Thanks!

ericxl commented 1 month ago

Is there any setup I might be missing? Thanks!

hwdsl2 commented 1 month ago

@ericxl Hello! For your use case, please first try to open specific inbound UDP ports (instead of all ports) in your EC2 instance's security group. For IPsec VPN, open UDP 500 and 4500. For WireGuard, open UDP port 51820. And for OpenVPN, open UDP port 1194. Make sure that you open the ports in the specific EC2 instance's security group. Refer to Amazon EC2 documentation.

If the above step doesn't help, try creating a new instance in a different region, or with a different Linux version. You can also try another cloud provider. Although unlikely, in certain cases It is also possible that the Internet Service Provider may be blocking the connection to the VPN server. A different VPN solution may be needed in such cases.