hwdsl2 / setup-ipsec-vpn

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

No internet after a while when connected to VPN #1539

Closed KornyAS closed 6 months ago

KornyAS commented 6 months ago

The issue is still here I just created the new certificate for my pc - connected it and in less than 10 minutes - I recieved No internet and I have to disconnect and connect again to my VPN. How can it be possible?

hwdsl2 commented 6 months ago

@KornyAS Hello! This could be caused by network issues between your VPN client and server. Do you see any errors in the Libreswan logs? Try:

# Ubuntu & Debian
grep pluto /var/log/auth.log
# CentOS/RHEL, Rocky Linux, AlmaLinux, Oracle Linux & Amazon Linux 2
grep pluto /var/log/secure
hwdsl2 commented 6 months ago

@KornyAS If you have additional information feel free to continue to reply in this issue, I can take a look. I'm marking this closed since it's most likely not an issue with the VPN script itself.

KornyAS commented 6 months ago

I looks like the possibility of multiple clients is completely broken. As soon as I created separate VPS for my phone - the problem vanished like a charm

hwdsl2 commented 6 months ago

@KornyAS Thanks for the update. Since you are now running multiple VPS, the following steps may not be needed. One thing to check is whether you have multiple IKEv2 client certificates imported on your PC, and if so, remove the extra one(s). For example, if you previously imported the default "vpnclient.p12" into your PC, and later generated and imported a new .p12 file, e.g. "vpnclient2.p12", both of these certificates would be in "Personal -> Certificates", and your PC may use the old one "vpnclient" to authenticate to the VPN server.

To check for and remove extra client certificates:

  1. On your Windows PC, run "certlm.msc" to launch the certificate manager.
  2. Go to "Personal -> Certificates".
  3. Check if there are multiple client certificates issued by "IKEv2 VPN CA". If so, keep the newest one you generated and imported (which is unique to this VPN client) and remove other certs issued by "IKEv2 VPN CA".
  4. Disconnect and re-connect the VPN.