Menu

Post image 1
Post image 2
1 / 2
0

How I fixed network state corruption in my Linux Tor proxy

DEV Community·onyks·26 days ago
#bwS3qw5f
Reading 0:00
15s threshold

Most transparent proxy scripts share a fatal flaw: if they crash, they take your system's network down with them. Firewall rules are left lingering, DNS is routed to a dead port, and you're forced to manually flush routing tables just to get back online. When building TTP (Transparent Tor Proxy) , I wanted to engineer a resilient system that survives crashes and prevents leaks, especially on modern distros dealing with systemd-resolved and firewalld conflicts. Here is the engineering approach I used to handle the three biggest network failure points. 1. Atomic Cleanup with Stateless nftables Modifying the system's default firewall rules requires complex backup and restore logic. It's fragile and prone to race conditions. Instead of touching existing rules, TTP creates a strictly isolated inet ttp table. I set the output hook to priority -150 to ensure TTP's redirection executes before any standard NAT or firewalld rules.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More