I have a linux machine and an external HTTP proxy.
I couldn't figure out how can I transfer the whole traffic (udp also if possible) of my system using iptables.
sudo iptables -t nat -N PROXY_CHAIN
sudo iptables -t nat -A PROXY_CHAIN -d [proxy-ip] -p tcp --dport [proxy-port] -j ACCEPT
sudo iptables -t nat -A PROXY_CHAIN -p tcp -j REDIRECT --to-port [proxy-port]
sudo iptables -t nat -A OUTPUT -p tcp -j PROXY_CHAIN
sudo iptables -t nat -A OUTPUT -p tcp -j PROXY_CHAIN
sudo /sbin/iptables-save
These are the commands I ran, but it's not working.