Please help with IPTables rules to route all TCP & UDP traffic of a user through a SOCKS5 proxy
by terente0081 from LinuxQuestions.org on (#5PWG3)
Hello everybody, I have a SOCKS5 proxy running on localhost on port 37337, no user/pass, and I want to use iptables rules to route all TCP & UDP traffic of a user through it.
I got these rules from the Tor project, they're supposed to do exactly what I need but they don't work when applied; internet crashes.
iptables -t nat -A OUTPUT ! -o lo -p tcp -m owner --uid-owner terry -m tcp -j REDIRECT --to-ports 37337
iptables -t nat -A OUTPUT ! -o lo -p udp -m owner --uid-owner terry -m udp -j REDIRECT --to-ports 37337
iptables -t filter -A OUTPUT -p tcp -m owner --uid-owner terry -m tcp --dport 37337 -j ACCEPT
iptables -t filter -A OUTPUT -p udp -m owner --uid-owner terry -m udp --dport 37337 -j ACCEPT
User & port are correct. Please help?
I got these rules from the Tor project, they're supposed to do exactly what I need but they don't work when applied; internet crashes.
iptables -t nat -A OUTPUT ! -o lo -p tcp -m owner --uid-owner terry -m tcp -j REDIRECT --to-ports 37337
iptables -t nat -A OUTPUT ! -o lo -p udp -m owner --uid-owner terry -m udp -j REDIRECT --to-ports 37337
iptables -t filter -A OUTPUT -p tcp -m owner --uid-owner terry -m tcp --dport 37337 -j ACCEPT
iptables -t filter -A OUTPUT -p udp -m owner --uid-owner terry -m udp --dport 37337 -j ACCEPT
User & port are correct. Please help?