I want to set my phone up in such a way that it won't connect to the internet before Tor (Orbot) has established a connection. How do I do that?


Stopping android from connecting to the internet/disabling wifi/disabling wifi module/disabling auto connect unless Orbot is up isn't trivial. It would probably need modifications to the ROM/kernel itself. You can use firewall rules and set them to block every connection besides TOR. It would still try to connect to the internet when Orbot is off but it wont succeed. Its much easier and works no matter what your internet source is (carrier or wifi), plus you can turn firewall rules off if you want.
EDIT: You can also use androids built in VPN option to route everything trough TOR. In that case if Orbot is off it will still try to connect to the VPN and fail therefore you want have internet.

  • Thanks for your answer. How do I set those firewall rules?
    – Morphior
    May 2 '16 at 5:22

There is some prior art in this field, however there is always an implicit Caveat Emptor when doing novel things.

The "OrWall" android application is intended to create a 'fail-closed' scenario, however it doesn't appear to be actively developed anymore.

It installs an init script that blocks outbound traffic with the intent that it stops applications making outbound connections before OrWall can start and set their profiles for what kind of connections are permitted for the app: https://github.com/EthACKdotOrg/orWall/blob/dd381cbfa5b3cea046dc1e00948a0cf8e0afbc26/app/src/main/res/raw/userinit.sh

It requires root, it will conflict with other apps that manage iptables settings (e.g. OrBot's own "TransProxy" mode) and it may be possible for traffic to leak before the init script is executed.


Impossible unless Tor is fully incorporated into AOSP firmware when compiled by hand. How to check: use wireshark or just a tcpdump on a wlan0 interface of your hostapd software AP. During bootup some apps are able to make a quirk before Orbot is started, see for yourself.

  • What about the always-on VPN option in Android settings? Is there a way to route Tor through that? May 1 '16 at 2:17
  • I used am Android Open Source Project, embedded Tor inside at the very early boot, then it worked. I doubt that VPN is not bypsssable and it needs the VPN tunnel client app running, so same problem
    – Alexey Vesnin
    May 1 '16 at 2:51

It seems that tor automatically do that when you check
Request root ☑ Transparent proxying ☑ Tor everything ☑

(requires root)

  • 1
    As already mentioned, other apps could potentially access the Internet without Tor while Android is booting, before Orbot gets a chance to start. Sep 28 '16 at 15:29

Thats not entirely possible but you could turn on the option to start tor automatically on boot. That will start tor automatically when you boot your device.

  • 1
    Again, system apps could access the Internet before Orbot starts. Why are you posting something that has already been said? Sep 28 '16 at 15:30
  • then you can use tethering through tor. Its available in orbot by doing that you can you can route all your traffic through tor but you would need another phone with data in it. That's one possible way
    – Dark Droid
    Sep 28 '16 at 15:51
  • I say that's a poor solution. You would need 2 phones, and one of them would still leak information for reasons already explained. Sep 28 '16 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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