-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VPN not working on Iphone while using Cellular Data #1526
Comments
@nikich700 Hello! The "retransmission" related errors in the logs, which can be seen in your description, is typical for the cases where traffic is blocked by e.g. the GFW. If you see those errors in the logs, I would suggest that you try alternative solutions other than IPsec VPN, such as Shadowsocks. |
@hwdsl2 But how is it possible that Android phones on very same Mobile data providers connect to my VPN server just fine while Iphones fail? Wouldn't ISP-side traffic blocking affect all phones, no matter the manufacturer? |
Hi! I found similar issue, when connecting from iPhone in cellular networks. When I use WiFi network - its connects without problems, There are also same logs using using ipsec status: Looks like cellular network provider (or something other) redirects udp packets to the wrong route and VPN server not get answer from client (and in another direction - server send, but client not get). Maybe there are exists something additional things, that can say to VPN server or routes - ok, we lost some packets, let's forget and resend again. P.s.: also try to make iPhone as router and connect laptop to iPhone's cellular network - same issue Windows 11 also with same behaviour like iPhone - same logs on server side. |
Here it is - WireShark log on server when connect from iPhone in cellular network: Only one something strange thing is - ICMP packet goes to strange ip address, not from any server/client subnet, but I think it's doesn't matter in this case |
What is weird is that I don’t see outgoing esp or espinudp. If the isp blocked it, i would expect to see outgoing packets without incoming packets.Are the server IP ranges or dns server ip received conflicting with the outer network ?Sent using a virtual keyboard on a phoneOn Feb 16, 2024, at 06:14, windofny1 ***@***.***> wrote:
Hi! I found similar issue, when connecting from iPhone in cellular networks. When I use WiFi network - its connects without problems, There are also same logs using tail /var/log/auth.log | grep pluto Feb 16 10:39:10 ubuntu-US-Miami-1gb-0 pluto[9206]: "ikev2-cp"[1] 95.153.162.12 #1: STATE_V2_ESTABLISHED_IKE_SA: retransmission; will wait 0.5 seconds for response Feb 16 10:39:10 ubuntu-US-Miami-1gb-0 pluto[9206]: "ikev2-cp"[1] 95.153.162.12 #1: STATE_V2_ESTABLISHED_IKE_SA: retransmission; will wait 1 seconds for response Feb 16 10:39:10 ubuntu-US-Miami-1gb-0 pluto[9206]: "ikev2-cp"[1] 95.153.162.12 #3: proposal 1:IKE=AES_GCM_C_256-HMAC_SHA2_256-ECP_256 chosen from remote proposals 1:IKE:ENCR=AES_GCM_C_256;PRF=HMAC_SHA2_256;DH=ECP_256[first-match] Feb 16 10:39:10 ubuntu-US-Miami-1gb-0 pluto[9206]: "ikev2-cp"[1] 95.153.162.12 #3: sent IKE_SA_INIT reply {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_256 group=DH19} Feb 16 10:39:11 ubuntu-US-Miami-1gb-0 pluto[9206]: "ikev2-cp"[1] 95.153.162.12 #1: STATE_V2_ESTABLISHED_IKE_SA: retransmission; will wait 2 seconds for response
using ipsec status: 000 Total IPsec connections: loaded 4, active 1 000 000 State Information: DDoS cookies not required, Accepting new IKE connections 000 IKE SAs: total(2), half-open(1), open(0), authenticated(1), anonymous(0) 000 IPsec SAs: total(1), authenticated(1), anonymous(0) 000 000 #1: "ikev2-cp"[1] 95.153.162.12:28472 STATE_V2_ESTABLISHED_IKE_SA (established IKE SA); RETRANSMIT in 29s; EXPIRE in 86335s; newest; idle; 000 #2: "ikev2-cp"[1] 95.153.162.12:28472 STATE_V2_ESTABLISHED_CHILD_SA (established Child SA); LIVENESS in 25s; EXPIRE in 86335s; newest; eroute owner; IKE SA #1; idle; 000 #2: "ikev2-cp"[1] 95.153.162.12 ***@***.*** ***@***.*** ***@***.*** ***@***.*** Traffic: ESPin=0B ESPout=0B ESPmax=2^63B 000 #3: "ikev2-cp"[1] 95.153.162.12:58188 STATE_V2_PARENT_R1 (sent IKE_SA_INIT reply); DISCARD in 166s; idle; 000 000 Bare Shunt list: 000 It's also reproduces on StrongSwan server. I connect my iPhone to Mac and look at WireShark, it always reproduced same behavior (for the StronSwan) - IKE_AUTH packets with Initiator Request and Responder Response just go away, not blocked. Same issue on the server side with WireShark (if need, i can log it and attach).
Looks like cellular network provider (or something other) redirects udp packets to the wrong route and VPN server not get answer from client (and in another direction - server send, but client not get).
Maybe there are exists something additional things, that can say to VPN server or routes - ok, we lost some packets, let's forget and resend again.
P.s.: also try to make iPhone as router and connect laptop to iPhone's cellular network - same issue Windows 11 also with same behaviour like iPhone - same logs on server side.
Here it is - WireShark log on server when connect from iPhone in cellular network:
image.png (view on web)
Only one something strange thing is - ICMP packet goes to strange ip address, not from any server/client subnet, but I think it's doesn't matter in this case
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
I don't think so, we try to build VPN server on another VPS server with another Server IP and local subnet - same behaviour. |
I am experiencing the same issue too. The weird thing is that it works sometimes and then it will stop working and after a while it will start working again... |
On Tue, 20 Feb 2024, Jiasong Huang wrote:
I am experiencing the same issue too. The weird thing is that it works sometimes and then it will stop working and after a
while it will start working again...
Be aware that some suppressive regimes do not block things, but make it
annoyingly bad but sort of working a little, so that you don't try
ohter solutions but just give up and blame bad technology. I am not
saying that is happening here, but it is a possibility.
Another item could be that NAT or CGNAT are timing things out or
are just broken.
Paul
|
I live in the U.S. and am using AT&T as my mobile provider. So I don't think it is a suppressive regime lol(hopefully) |
@hwdsl2 Hi. I've been using your solution for a long time and after recently changing my VPS server I started deploying the image again and ran into the same problems as in this thread. Previously (Nov 2023 minimum) everything worked fine on both wifi and Cellular. I checked on other servers with l2tp (I don't have access to them) and ios connects without problems. the problem is this particular image |
@maffinca69 Hello! It looks like you are using the Docker image. What is your Docker host's Linux version? You may try the version from August 2023 using the following steps:
After that, re-create the Docker container using instructions from the last paragraph of Update Docker image. When finished, enable Libreswan logs, then try the connection again. If the issue persists, it may not be caused by the image itself. There's a chance that this was caused by upgrading the base image from Alpine Linux 3.18 to 3.19, which uses nftables by default. Note that the image already uses legacy IPTables for compatibility. If the manually built older image (based on Alpine 3.18) works for you, let us know. |
@hwdsl2 Hi. Thanks for the quick reply :)
|
@maffinca69 Thanks for the update. What is your Docker host's Linux distribution and version (e.g. Ubuntu 22.04)? |
@hwdsl2 |
@hwdsl2 any update? |
@maffinca69 I tested using the latest Docker image and Debian 11 as the Docker host, but was unable to reproduce this issue. Connecting to IKEv2 from both Wi-Fi and cellular worked fine in my tests from an iPhone. Could the issue be caused by weak mobile network signal in your case? If you have additional logs related to this issue (reference) please share. |
@maffinca69 hwdsl2/docker-ipsec-vpn-server#424 may be a similar issue. So far, I haven't been able to reproduce this issue. |
@hwdsl2 Hi. Unfortunately, this bug does not reproduce for me personally (connects but nothing loads), but it does for my friends who connect to the same server from the same phones and ios versions. I looked at the logs but couldn't find anything suspicious |
I experience the same issue. Are any solution so far? |
Any suggestions? |
same on my iphone, wifi works well, mobile network not working. android on same mobile operator works well, so this problem not with mobile operator or something |
Have you found any solutions? |
No, also i tried outline, both not working with mobile operator, so i believe this issue reletated to it after all. or idk how other vpns in stores works well |
@SnaiperoG3D sadly. Thanks for the input anyway. |
I have tested my VPN on 4 phones:
2 Android phones (one on ISP-a, other on ISP-b).
2 Iphones (one on ISP-a, other on ISP-b).
Both Android phones connect to VPN flawlessly no matter connection type (WiFi or Cellular).
Both Iphones are able to connect to VPN only through WiFi. Trying to connect using Cellular on both ISP-a and ISP-b fails. It just says "connecting..." and after several seconds message pops up: "VPN Connection. The VPN server did not respond."
Checking logs I have seen:
Considering that VPN works fine on Android phones on ISP-a and ISP-b, I figured it must be not them blocking traffic but rather something else.
Any suggestions on what I can do to fix this issue?
Thank you in advance.
The text was updated successfully, but these errors were encountered: