I connect thought tunnel to other machine like this: ssh user@ip -L2000:192.168.64.88:80
So on my local machine I want to configure iptables that way like I have a "native" access to 192.168.64.88 address. I mean when I enter on web browser http:// 192.168.64.88 iptables will redirect to my localhost port 2000 which is connected to remote machine.
How can I configure iptables to redirect from 192.168.64.88 port 80 to localhost port 2000?
I tried this but with no luck:
sudo iptables -t nat -A PREROUTING -p tcp -d 192.168.64.88 --dport 80 -j DNAT --to-destination 127.0.0.1:2000
On mac os x machine I do it like this:
sudo ifconfig lo0 192.168.64.88 alias
sudo ipfw add fwd 127.0.0.1,2000 tcp from me to 192.168.64.88 dst-port 80
But I don't know how to do this on linux machine.