Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On an android phone, stock or modded rom, is it possible to force the use of VPN? E.g. only allow traffic tunneled by VPN, don't allow traffic without using VPN to make sure that no unencrypted traffic leaks. Thanks for any hint!

share|improve this question
Are you having a problem with "leaked" traffic, or just assuming that using a VPN with Android is unreliable? If the latter, would you not also assume that any "force VPN" method is unreliable? – Matthew Read Sep 3 '11 at 22:39
both ;-) on mobile usage connections (VPN) are always unreliable, so when VPN gets disconnected, I want to make sure that no traffic gets send until the VPN connection is re-established. – Sep 4 '11 at 14:49
Ah, fair enough! It might be possible to use an app like Tasker to turn off data when you lose your VPN connection, but I don't know the specifics. – Matthew Read Sep 4 '11 at 17:55
Looks like you want to apply a security policy to a device... – Robert Sep 22 '11 at 13:41
yes, it some way it's a security police - but that's not supported on normal android versions, right? ): – Sep 28 '11 at 10:44
up vote 7 down vote accepted

Answering an old question, I know, but Android 4.2 has "Always-on VPN" in the menu on the VPN Settings page: setting a VPN profile under this will maintain the VPN connection, and only allow network traffic when connected to it.

More info:

(It may have been added in an earlier version of Android, but my Nexus 7 auto-updated before I got around to setting up the VPN :)

share|improve this answer
wow, that is cool! and if it works like described, it perfectly solves my problem! luckily I have a galaxy nexus with 4.2.1 :-) Thank you very much for answering this old question! Of course selected as correct answer :-) – Jan 3 '13 at 16:14

You could install Orbot on your phone and install a bridge on your server.

  • Depending on your needs, you might want to restrict bridge access via a whitelist. (Please see comments)
  • This isn't a true VPN, but provides the same functionality.
  • Orbot can force ALL traffic or app-specific traffic.

enter image description here

  • Orbot [02/20/12]
share|improve this answer
Thank you, but I think there's one downside on this: I don't want to route my traffic over foreign computers and when I set up a bridge at home I guess traffic is routed from my bridge at home to the tor network and then to it's real destination? ): – Mar 1 '12 at 13:50
If you were to (correctly) set up a bridge on a server that you owned, you could 1) Limit who could use it (only you) and 2) Have it be the 'exit node', so that all of your traffic would leave from this server and not use any other Tor servers. :D. This is a very powerful tool, but you may find other users with experience with other tools that will suit your needs more easily. – earthmeLon Mar 2 '12 at 4:58
Hmm I would I make sure I am the only one who can use it? Seems like there's no kind of authentication? – Mar 2 '12 at 20:57
I imagine you would start by using Tor's configuration (check their documentation) and iptables to restrict usage. Like I said, there is probably a 'better' solution for you, but I personally trust TorProject's Orbot more than any other VPN solution currently available. I plan to set this up myself and provide a tutorial soon. – earthmeLon Mar 4 '12 at 19:52
According to a user from the tor help mailing list there is unfortunately no kind of authentication for bridges. – Mar 4 '12 at 23:54


enter image description here

SSHTunnel is an ssh tunnel/vpn solution for Android. When I first found SSHTunnel, users were forced to use an application's settings to use SOCK5 proxy, but now sshtunnel can handle per application and global use on its own. Just like rooting is required to get the full functionality of Orbot, you will need a rooted device in order to get what you need from SSHTunnel.

Although this is not a VPN, this is a much simpler setup that will give you an encrypted tunnel to your server. You can interact with your server through this connection directly, or use it to receive or bounce traffic outwards.

  • Note: Unencrypted traffic sent to your server (ie http) will be encrypted through your ssh tunnel, but it will still be clear/unencrypted once it leaves your server.

Links & QR

SSHTunnel QR

share|improve this answer

Your Answer


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.