Question: I managed to get all traffic routed through tor using the following this [documentation](https://trac.torproject.org/projects/tor/wiki/doc/TransparentProxy).

I want now to know if it's possible to turn this on and off on command. I've tried reversing it with the following to no avail:

```
#!/bin/sh

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD

```

Does anyone know how this would be possible?

Answer: 
1. You need to flush the NAT table too, as dingensundso suggests: `iptables -t nat -F`
2. You probably don't want to just `ACCEPT` all `INPUT`, `OUTPUT`, and `FORWARD` traffic, this would disable packet-filtering (your "firewall") entirely.
3. Just switching Tor on and off is a terrible plan for anonymity. Your applications will keep state between your usage inside and outside of Tor and this state will potentially link your Tor usage to your non-Tor usage, deanonymizing you.
Just bind it - if you're using IPTables - to the username. Create a username, let's say `clearnet` and allow all the traffic for it to be direct.