Quote:
Originally Posted by _TeRmInEt_
Server A: x.x.x.x and it is eth0:1
Server B: y.y.y.y
Code:
-A PREROUTING -d x.x.x.x/32 -p tcp -m tcp --dport zzz -j DNAT --to-destination y.y.y.y:www
-A POSTROUTING -o eth0 -j MASQUERADE
Whit that rules I can connect to x.x.x.x:zzz and it reponse y.y.y.y:www
The problem is that x.x.x.x is exit with another ip (eth0)... I would like that x.x.x.x connect to y.y.y.y, is there a way?
Thank you
|
this seems to work for my script
Code:
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 40568 -j DNAT --to-destination 192.168.0.10:40568
so it should be right what you are doing
i dont know what your scripts is like
but if you are making or also having a firewall
maybe thisline will help
Code:
iptables -A FORWARD -i eth0 -p tcp --dport 40568 -j ACCEPT