Android 4.2 'always on vpn' no internet access - android

I have configured an IPSEC vpn on my Samsung Nexus tablet (4.2), the VPN works perfectly fine when I connect it manually. I have full vpn and internet access.
However, when I set it to 'always on vpn' I lose internet connectivity. I can still access all local devices i.e servers / printers but nothing outside of the vpn network.
I can't ping any external addresses like 8.8.8.8 or access any websites that are not on the intranet.
I have been trying different things - setting forward routese etc but nothing seems to work so far.

This is bug in Android 4.2+ firewall. You can try fix, available on Google Play and called AlwaysOnVpnFix. But because this fix recover firewall rules, root access is required. Else your must wait next Android release by Google ;'(

Related

Connect to VPN in Genymotion Android using OpenVPN Connect

I am trying to use OpenVPN connect in a Genymotion desktop (3.0.4) emulated Galaxy S10. When I try to connect the VPN the emulated device hangs and no longer responds in the console. I have to restart the virtual device. The VPN profile I am using works on a physical Android device without issue.
I have tried altering network adapter configurations, this does not change behavior.
Any suggestions?
Almost every vpn provide options to modify apps which bypass the vpn connection (in fancy word split tunneling) so just select one apps that you need to use through vpn or just allow all system apps bypass vpn connection.
Just go to your vpn profile and adjust the settings as suggested.

no dns via ipsec tunnel android 4.4.2 xperiaz C6603 racoon

I've setup a racoon server on my linux router. It was working ok with my xperiaz (C6603) road warrior. However after I applied the latest update to android 4.4.2 (firmware 10.5.A.0.230) it stopped working correctly. I have ping from the phone to each ip (local ip or internet) but when I use FQDN it can't be resolved. I can ping the phone from within my local network too. VPN is IPSec Xauth RSA. Checking with adb DNS server is correctly set:
getprop net.dns1
192.168.6.1
I also tried pushing the same ip as dns2 but no change. I also noticed that after closing the connection to the vpn server net.dns1 remains 192.168.6.1 however the phone is able to correctly resolve addresses. In few minutes it gets changed back to my 3g provider setting.
I tried to redirect all traffic through the tunnel via the advanced vpn setting (Forwarding routes = 0.0.0.0/0) and tried to set DNS statically via the same settings (DNS servers = 192.168.6.1). Even setting the DNS server to my provider's DNS addres didn't work which makes me think the problem is with the android itself.
DNS server is working as far as I can tell:
$ dig #192.168.6.1 dir.bg +short
194.145.63.12
Forwarding is enabled on my router so shouldn't be the problem. I've read about a bug in android but it's in android 2.x and seems to impact wifi connections.
Have you seen similar problems and as I'm not an expert with android and adb, can you tell me what commands are available in adb/shell to trace the problem? Phone is not rooted and it's not possible for the moment to root it.
UPDATE:
the tunnel is working ok when I connect via wifi hotspot. The problem appears to show only via my 3g carrier. Any ideas how to work around this?
After updating to 4.4.4 I still got the same problem. Further testing revealed that the problem is more likely to be in the Android rather than my 3g carrier. Over wifi the VPN worked flawlessly after using wifi tethering from another phone via the same provider it worked ok again so my 3g carrier isn't blocking anything.
Yesterday I finally rooted my phone and installed SDFix to restore full access to my SD card. Now VPN is working ok again even via 3g. I hope someone can confirm/reject that solution as I see no relation between vpn and sd card at all. However I experienced initially the problem with my update to 4.4.2 where Sony started to follow Google's policy about storage access.

Setting up Charles proxy causes emulator to lose internet connection

So I'm trying to set up Charles on a Mac (running Mavericks). I have Charles installed, set up the Proxy Settings by adding * as the SSL locations (which means it should accept traffic from everywhere, right?).
Then I went into my emulated Android device running 4.4.2 and went to http://charlesproxy.com/charles.crt to get a certificate, accepted the certificate and added a pin to the emulated device for it, and it said it was installed.
The internet still works on the emulated device. I then go into my internet settings on this emulated device to set up the proxy to my machine, and after doing that, the internet dies out, and I cannot access anything. The only way to regain internet is to wipe the emulated device and start over. I've now done this a couple times to confirm the result and it is when I set my proxy settings on the device that the internet dies.
Anyone have any experience with this issue and could offer some help?
I have found the solution. My proxy settings that I was told were correct on the emulated device were actually incorrect, I was trying to use a device name instead of a local IP address. Make sure you use your local IP address, which can be found by (in Charles) going to Help->Local IP Address...

How can I get my android emulator use my computer's VPN interface?

My company requires VPN to connect to our dev systems and for the first time I'm trying to work on an android app from home. Turns out the emulator doesn't want to use the VPN interface so even though I have connectivity to our dev systems on my VPN-connected laptop the emulator that's running on it does not.
I have thought of 3 solutions to this:
run a VPN client on the emulator, but I was hoping for a simpler solution than that
setting up a proxy server on my local machine
forwarding a port on my local machine
2 and 3 can probably work, but I'd still like to know if there is an easy way to get the emulator to use the VPN interface without a workaround.
I'm running OS X 10.7 and I've already tried adjusting the interface priority order with network>>set service order.
I suppose I can dust off the old dell and try it there, but I would expect the same results.
First start your vpn connection and then restart the emulator, now the emulator should use the host vpn connection.
it's mostly because of the DNS issue, according to the android doc:
At startup, the emulator reads the list of DNS servers that your system is currently using. It then stores the IP addresses of up to four servers on this list and sets up aliases to them on the emulated addresses 10.0.2.3, 10.0.2.4, 10.0.2.5 and 10.0.2.6 as needed.
I encountered this issue and tried something on dns settings but I could not solve it. As #machado said in the comment section below you should boot the emulator via "Cold Boot Now" option. I hope this helps.
What I do on my mac is just make sure 'send all traffic over vpn' is checked.
You'll find this setting after you click advanced while having your vpn connection selected in network preferences.
Works well for my situation, but may not depending on the type of VPN you're connecting to.
I had the same issue and solved it by connecting to cisco vpn after the android emulator has started and connected to the internet.
Works for me in windows 7
I setup a vpn connection on Windows. Then I started the emulator. The emulator and everything on my pc started to use that vpn connection.

Android "localhost" sockets fail when no data connection?

I'm designing an Android app that will require the use of a web server on the local device. I've been trying out some different servers for this purpose. At present I haven't written any code or run anything in an emulator, just played around with the servers on my actual phone, and I'm observing some strange behaviour.
Whenever I try to connect to the local web server, and I have WIFI switched off, the HTTP request fails. If I switch WIFI on, it succeeds.
Depending on which address I use, I get different results: using localhost or 127.0.0.1, I get connection refused when WIFI is off; using the current 10.X.Y.Z address I get a timeout. Both addresses work when WIFI is on.
I have tried this with xWS, PAW and i-Jetty: the behaviour is consistent. WIFI on, I can connect to the local web server; WIFI off, I can't.
I am using the default "Internet" browser on Android 2.3.3 on a Samsung Galaxy S (GT-I9000).
Does anyone know why this is? Is it a simple question of a setting somewhere I need to change, or what's going on?
Cheers,
/Uffe
Can you change the network interface the web server is connected to?
The default setting is probably something like eth0 or wlan0, if you change it to lo it could work.
You are asking why when you turn off your wifi, there is no connection to the 10.0.0.2 (Your computer's localhost) and when you turn it on, there is a connection?
Very simple. Wifi off - NO INTERNET connection. The device emulator is a separate OS inside your computer's OS. When you turn off your WIFI there is no route to the host (your computer) - there is no internet
I have now tested with my own simple client, and with Opera - and it works.
So in fact this is an issue not with the IP stack but with the default Android browser, or possibly with the settings enforced by the manufacturer (Samsung) or carrier (Telenor Sweden). Either way there is a workaround: use Opera instead.
Still don't know why it doesn't work with the default browser, but I'll mark this question answered.

Categories

Resources