Skip to content

rezacho/torgate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TorGate

Force all system traffic through the Tor network.

TorGate is a transparent proxy tool for Debian-based Linux systems that routes every connection through Tor — not just your browser, but all traffic from every application on your system. If Tor goes down, all traffic is blocked. Nothing leaks.

Features

  • Transparent proxy — all system traffic routed through Tor via iptables
  • Kill switch — if Tor disconnects, all traffic is blocked (no leaks)
  • DNS protection — all DNS queries routed through Tor
  • MAC spoofing — randomizes MAC addresses on all active interfaces
  • IPv6 disabled — prevents IPv6 leak vectors entirely
  • Bridge support — obfs4, snowflake, and meek_lite for censored networks
  • Safe rollback — Ctrl+C during startup or any failure restores your original settings

Requirements

  • Debian-based Linux (Ubuntu, Kali, Mint, etc.)
  • Root access

Support for Arch, Fedora, and other distributions is coming soon.

Installation

git clone https://github.com/rezacho/torgate.git
cd torgate
sudo ./install.sh

The installer handles all dependencies automatically (tor, obfs4proxy, snowflake-client, curl).

Quick Start

# Start — route all traffic through Tor
sudo torgate start

# Check status and your Tor exit IP
sudo torgate status

# Stop — restore normal connection
sudo torgate stop

Bridge Support

If Tor is blocked in your network, use a bridge to bypass censorship:

sudo torgate start -o          # obfs4 — fast, defeats DPI (recommended)
sudo torgate start -s          # snowflake — looks like video chat
sudo torgate start -m          # meek_lite — hardest to block, slowest

Before using bridges, add your bridge lines to the config file:

sudo nano /etc/torgate/torgate.conf

Get free bridges from:

Note: Do not include the Bridge prefix that torproject.org provides. Use obfs4 1.2.3.4:443 ... not Bridge obfs4 1.2.3.4:443 ...

How It Works

Starting — TorGate backs up your current network settings, then:

  1. Spoofs MAC addresses on all active interfaces
  2. Disables IPv6 system-wide
  3. Configures iptables to redirect all TCP through Tor's TransPort and all DNS through Tor's DNSPort
  4. Sets default iptables policy to DROP — only Tor can reach the internet
  5. Starts Tor and verifies the connection

Stopping — TorGate restores everything to its original state:

  1. Stops Tor
  2. Restores iptables, DNS, torrc, and MAC addresses
  3. Re-enables IPv6

Verbose Mode

To see full Tor logs during startup (useful for debugging):

sudo torgate start -v
sudo torgate start -o -v       # combine with bridge option

Uninstall

sudo torgate uninstall

Or use the standalone uninstall script:

sudo ./uninstall.sh

Security Notes

TorGate provides strong system-level anonymity, but keep in mind:

  • Browser fingerprinting can still identify you
  • Application protocols like torrents can leak identity
  • Personal accounts — logging into identifiable accounts defeats anonymity

License

This project is licensed under the GNU General Public License v3.0.

About

TorGate – Route all system traffic, DNS queries, and applications through Tor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages