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
Wi-Fi hotspot enabled on host device with OpenVPN connected... connected client devices have no internet #34
Comments
Original comment by
|
Original comment by |
Original comment by |
Original comment by |
Original comment by |
Original comment by |
Original comment by |
Original comment by |
Original comment by |
Original comment by |
This is how to get tethering to work regardless of OpenVPN and hotspot startup sequence on Lollipop, with the caveat that it bypasses the VPN tunnel.. |
@danieljarolim from my experience Hotspot on 4.4+ works without these tricks and always uses the non VPN connection |
@schwabe I realsied I was using the vpn provider's profile so tried again with a default configuration but ended up with same results. This is on Android 5.1.1. It's on an old phone so it's a custom ROM but should be close to AOSP defaults. |
@danieljarolim All I can say that it works on Nexus devices out of the box. |
I know this has been closed for a while but it still persists. I suspect the cause (and why it works in 4.4+) is the When enabled, a separate 'dial-up network' is created specifically for tethering. This would allow tethering to be active while the standard network device has an active OpenVPN connection - they are using separate network devices. With some custom ROMs (and possibly AOSP?), (I'm running BrokenOS 4.9.1 on my Nexus 5) |
Sorry to reopen a closed issue, but is there a solution to this bug? If VPN is active, devices can't get IP thru wireless tether |
You can try to exclude 192.168.42.0/24 (the hotspot range) |
Where do I find the option to exclude it? |
under excluding routes |
I tried to exclude the 192.168.42.0/24 but got no luck. The device can't get an IP address from my hotspot. I have to disconnect from my VPN, connect the other device to my hotspot, and then reconnect the VPN. This way it works. But if the VPN is connected, the device trying to connect to my hotspot can't get an IP address |
@otaviobps there is probably nothing the app can do about that then. :( |
On my device, 192.168.42.0/24 is for USB tethering; for WiFi tethering I have to exclude 192.168.43.0/24. (Or just use 192.168.42.0/23 for both.) Clients connecting via either won't route via the VPN, though (which would have been the better solution; maybe some iptables rules would fix that). I have clients able to connect and VPN active on the phone with: Include: 0.0.0.0/0 |
I could solve the problem by assigning a manual IP on the device connecting to my hotspot. Maybe the VPN interferes with DHCP |
I think what we're really trying to do actually needs server-side configuration to work - whether it's routing or bridging I'm not sure yet, but essentially the phone has to act as a router for its client devices. If this is what's needed, I don't think it's in scope for this app. :) |
I don't think server side configuration will help. The dhcp stuff is probably a bug in Android itself. |
Here's my thinking: With the simplest setup, the phone is acting as a client. The server has already provided a DHCP address to the phone; if it's getting other requests from what it sees as the same client it won't do anything as the current lease is still valid - it has to know the client is actually acting as a router/gateway, and service the other requests appropriately. |
@jonathonf in hotspot mode the phone itself is the DHCP server. |
Right, in plain hotspot mode clients will get an IP address from the phone's DHCP server. However, when the OpenVPN client is running, by default it is redirecting all traffic to the OpenVPN server, meaning any client traffic is also being redirected. Hence, the clients aren't talking to the phone's DHCP server any more - they are talking to the OpenVPN server, and if that doesn't provide an IP address via DCHP then the clients connection attempts will "hang". However - if the phone acts as a gateway to the OpenVPN network for its hotspot clients, everything should work - instead of clients being given an IP address by the phone, they will be given an address by the OpenVPN server. |
Hello guys, Could you please provide a short step by step procedure on how to do the following in android terminal. Include: 0.0.0.0/0 My devices are stuck in obtaining ip addresses. Please help. |
Look in the VPN connection settings. No need for the terminal. "OpenVPN for Android"... Profiles->Edit profile... Routing->Excluded Networks. |
Hi @jonathonf. Thank you for the quick response. I really appreciate it. So, I went to Settings>Connection>VPN>Turbo VPN. I couldn't find a setting to include or exclude these addresses. Any workaround to do in emulator? |
Turbo VPN does not sound anything that would be in my app. Are you sure that you are using my app? |
Hi @schwabe. Forgive me, I must be off-topic. But the discussion in this thread matches my issue. Scenario: I am trying to execute android "Mobile Hotspot (wifi)" on my s7 edge device that is connected to a vpn. However, when the other android devices start connecting, they are getting the "Fail to obtain ip address' error. Your helpful replies in these thread say that I should include or exclude a particular IP address from the VPN. And, I really want to do it, but I am not sure how to do that in the terminal. Please help. |
@mae1989 The VPN app has to implement this. If not you would need root for that and (very) good understanding of ip rules and iptables to figure out how to manipulate the policy based routing to achieve that. But I cannot help you with that either since my phones are not rooted. |
Hi @schwabe. My phone is rooted. Now, I am just basically lost how to add/exclude those addresses within terminal. I wish someone could help. Thank you for taking time on my issue. In case, someone could help, I have attached the the results using ifconfig and ip route. |
Hi again @jonathonf and @schwabe. Btw, thank you for pointing out how to exclude the address in OpenVPN. I tried it and it works great! My devices are now connecting. You guys are awesome. I bet I need to move to OpenVPN instead of other vpn apps, until I figure the solution for those. :) |
Is it really fixed?
|
This has already been covered. Read my comment above and you'll see that the clients are excluded from the VPN. |
See also the FAQ. Connected clients via Tethering always use the normal connection and not VPN |
1° The FAQ does not mention Android > 5.1 |
Original issue reported on code.google.com by
sinat...@gmail.com
on 26 May 2012 at 8:22The text was updated successfully, but these errors were encountered: