How do you properly setup Tor on a Windows 7 box to guarantee that ALL connections will run through Tor?
You should be able to to that with the Windows Firewall "with advanced functionality" (something like that), as this firewall knows about local processes: you can make per-program rules (a "program" here is actually just a file name, as for example
So you should be able to:
- block all outgoing packets (for all protocols, not just TCP or UDP)
- allow everything only for the Tor program, defined by its file name (often
C:\Program Files\Vidalia Bundle\Tor\tor.exe). For a working Tor relay, you must allow both outgoing (active open) and incoming (passive open) TCP connexions.
- A Tor exit node needs to do DNS resolution. You might need to unblock the Windows DNS resolver if it is a standalone process - or is the resolution done by each program?
- I have not tested this configuration.
- Before changing any firewall rule, make sure you understand Windows firewall UI and what the rule means.
- Before making a block all rule, make sure you know how to reset the firewall to normal state (without turning it off, unless it is usually off).
- With Windows you can have different "profiles" with different firewall configurations. Make sure Windows 7 does not automatically change active profile without user confirmation (as Windows Vista sometimes does).
When creating Windows 7 firewall rules for Tor, creating rules for the unzip'd Tor software on your desktop may not work.
This is because the Windows firewall doesn't work well with pathnames such as "%APPDATA%", etc, that end up in the pathname for rules when allowing the tor.exe client.
So if you've got Tor unzip'd on your desktop and "any any" rules for it aren't working in your Windows 7 firewall ruleset, try putting Tor in "C:\Program Files (x86)" instead and adjust firewall rules accordingly.
You cannot guarantee that all connections will route through Tor, no matter what operating system you are using. Tor cannot route UDP traffic and is only able to route TCP traffic.
For your TCP traffic you can simply follow the Documentation on the Tor Project Website