Setting up `iptables` for use with an external HTTP proxy
0
votes
1
answer
257
views
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.
Asked by Mr Wrench
(1 rep)
Apr 10, 2023, 12:41 PM
Last activity: Mar 19, 2025, 03:51 PM
Last activity: Mar 19, 2025, 03:51 PM