Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

If I set up a VPN connection for Android, what gets routed over the VPN? Just web browsing? All internet connections from all apps?

In Cyanogenmod, in the Add OpenVPN config, "Advanced" settings, there is an option for "Redirect gateway - Force all traffic to berouted thru the VPN tunnel", which is off by default.

With this off, which apps/communications get routed through it?

The other VPN types do not have this option. Do they work this way or not?

After setting up a VPN, how can I verify that it's working?

share|improve this question
add comment

2 Answers

The setting that you're talking about is in effect the --redirect-gateway option of OpenVPN and is documented on the OpenVPN man page

--redirect-gateway

Automatically execute routing commands to cause all outgoing IP traffic to be redirected over the VPN.


This option performs three steps:

  1. Create a static route for the --remote address which forwards to the pre-existing default gateway. This is done so that (3) will not create a routing loop.

  2. Delete the default gateway route.

  3. Set the new default gateway to be the VPN endpoint address (derived either from --route-gateway or the second parameter to --ifconfig when --dev tun is specified).

When the tunnel is torn down, all of the above steps are reversed so that the original default route is restored.

The routing of all network connections occurs at the system level. Only apps that have the ability to modify the routing table of the device to use a different gateway than the default can bypass the VPN. Theoretically any app with SuperUser access could do this.

share|improve this answer
add comment

Typically, yes.

You're creating a private network -- you want to route stuff through the network. It's private.

If only the browser applications were routing through the private network -- some other app could be sniffing activity, and sending it through the other connection. Goodbye, private!

See Also:

share|improve this answer
    
Yes, that's what it should do. I'm asking what it does do, in the specific context of an Android device. –  endolith Nov 8 '10 at 15:12
    
I haven't found any information saying that any Android VPN implementations are not really VPN implementations -- that they are, indeed, private, virtual networks in the commonly accepted understanding of the term. There is no evidence to suggest otherwise. –  Michael Paulukonis Nov 8 '10 at 16:10
1  
No evidence until someone finds some ;) I think the question is, based on the way VPNs are coded in Android is there a way for a rouge (or poorly coded) app to miss/bypass/ignore the VPN & connect through the standard connection? I'm not dev but an example in laymen's terms would be a VPN app that tells Android that all connections should go through it, but a poorly coded app may not even ask Android where to route network traffic & assume it should go about biz as usual. On the other hand if the VPN takes over the connection management entirely I'd feel more comfortable that it'll work. –  Matt Nov 9 '10 at 2:36
    
There's a comment on android.stackexchange.com/questions/8904/… that says that web browsing does not go through the VPN. –  endolith Oct 10 '11 at 22:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.