From a46d302ba8e5e36521d940c8f2359da3a1063c3f Mon Sep 17 00:00:00 2001 From: CaliBrain Date: Sun, 16 Nov 2025 00:15:36 -0500 Subject: [PATCH] Add iptables rules to bypass TOR for local networks (#314) Added iptables rules to bypass TOR for local and private networks. Tentative fix for #306 --- tor.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tor.sh b/tor.sh index 246c142d..13675587 100644 --- a/tor.sh +++ b/tor.sh @@ -56,6 +56,12 @@ iptables -t nat -F # Allow loopback iptables -t nat -A OUTPUT -o lo -j RETURN +# Bypass TOR for local/private networks +iptables -t nat -A OUTPUT -d 10.0.0.0/8 -j RETURN +iptables -t nat -A OUTPUT -d 172.16.0.0/12 -j RETURN +iptables -t nat -A OUTPUT -d 192.168.0.0/16 -j RETURN +iptables -t nat -A OUTPUT -d 127.0.0.0/8 -j RETURN + # Redirect all TCP to Tor's TransPort iptables -t nat -A OUTPUT -p tcp --syn -j REDIRECT --to-ports 9040