I have a linux machine used as gateway for a Win XP machine. Both are in Virtual machine for testing purpose. Now I want to trick the Win XP user (me) with the forwarding of an IP address: I want to change the destination IP address.
For example I want to go to 1.1.1.1 but linux gateway change it to 2.2.2.2
So if I'm expecting the web page of 1.1.1.1, I'll get the changed one, the one of 2.2.2.2
For example I want to go to Facebook and I'm forced to Google home page.
How can I do it? With prerouting?
Because I've done lot of tries, but no one working :(
-t nat -A PREROUTING -d 1.1.1.1 -j DNAT --to 2.2.2.2should do it. You'll need a POSTROUTING SNAT as well so the response returns through the gateway - if it's a NAT'ing gateway I presume you already have that – Erik Apr 28 '11 at 10:24-t nat -A POSTROUTING -o eth0 -j MASQUERADE, and tried lot of other configuration. Still not working. Any ideas? – Possa Apr 28 '11 at 12:16