clan@xxxxxxxxxxxxxxxxxx wrote:
To make it work I had to change PREROUTING to OUTPUT. So is there a way
for that to only effect certain source ip's?
If the packet originated from localhost, then OUTPUT is correct. -s is
source and -d is destination ip.
iptables -t nat -A OUTPUT -s 3.3.3.3 -d 1.1.1.1 -p tcp -m tcp --dport 80
-j DNAT --to 2.2.2.2
Should work for you. Remove your previously inserted rule first though.
Please read the manual page of iptables and/or
http://iptables-tutorial.frozentux.net/iptables-tutorial.html
HTH,
Alex