hwdsl2 / docker-ipsec-vpn-server

Docker image to run an IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
https://hub.docker.com/r/hwdsl2/ipsec-vpn-server
Other
6.37k stars 1.38k forks source link

Cannot connect to any host on Android with StrongSwan #353

Closed ArchiDevil closed 1 year ago

ArchiDevil commented 1 year ago

Checklist

Describe the issue When I connect to the server via StrongSwan I cannot open any site. Tried it on multiple VPS and multiple Android devices.

To Reproduce Steps to reproduce the behavior:

  1. Install VPN server to your VPS
  2. Set up StrongSwan using the guide here (by importing configuration from .sswan file)
  3. Connect to VPN
  4. Try to open any website.

Expected behavior Sites should be opened and applications should connect.

Server (please complete the following information)

Client (please complete the following information)

Additional context Logs from StrongSwan are here: charon.log

It works as expected if I use IPsec/L2TP auth.

hwdsl2 commented 1 year ago

@ArchiDevil Hello! Thanks for reporting this issue. I tested this use case (Android using strongSwan VPN client and IKEv2 mode) and it worked fine.

Your strongSwan logs look normal. Because you tried multiple Android devices and multiple hosting providers, and observed the same issue, I suspect that the issue may be with your home router (if applicable). Try connecting via cellular (4G/5G) and see if the VPN works fine. If so, the issue may be with your router.

For additional troubleshooting information please see: https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/ikev2-howto.md#cannot-open-websites-after-connecting-to-ikev2

You can also try setting up the VPN directly on a new server without Docker.

ArchiDevil commented 1 year ago

I tried everything from these instructions, of course. Nothing helped. How can I debug the issue? It seems like traffic from my device is not routed, but iptables output looks fine. What can I do to find the issue?

hwdsl2 commented 1 year ago

@ArchiDevil Try connecting via cellular (4G/5G) and see if the VPN works fine. If so, the issue may be with your router. To check whether it's a DNS issue (unlikely), try visiting e.g. https://1.1.1.1 after connecting to the VPN.

For further troubleshooting, you may enable and check Libreswan (IPsec) logs on the server, see Enable Libreswan logs.