Foraward Traffic from local machine to proxy server using iptables

Posted by Vaibhav on Ask Ubuntu See other posts from Ask Ubuntu or by Vaibhav
Published on 2013-11-09T03:17:40Z Indexed on 2013/11/09 4:18 UTC
Read the original article Hit count: 298

Filed under:

I am using Ubuntu Server 12.04. My IP is 192.168.4.160. I want to route the HTTP traffic generated locally from my system destined to a particular URL (say x.x.x.x) to pass through proxy server. My proxy server is 192.168.0.13:3128. I added following rule in iptables

sudo iptables -t nat -A OUTPUT -p tcp -d x.x.x.x --dport 80 -j DNAT --to 192.168.0.13:3128

However, this rule does not seem to work for me. I captured packet in wireshark and I saw that packet is still going to x.x.x.x

I am not very much familiar with iptables, so please try to be specific. Thanks in advance

© Ask Ubuntu or respective owner

Related posts about iptables