We have 5 CentOS servers performing different tasks. We use VNC for all the servers as they are screen mouse and keyboardless. That all works no problem. I need to be able to log into all from remote locations outside the local network, at present I log into the firewall and run VNC from there to access the rest, this makes things a little slow on the screen. I would like to access the servers on separate ports and have the firewall redirect them to port 5900 on the relevant servers
lan interface eth0
public interface eth1
How do I get vnc to be redirected to port 5900 on server1 when I type public_address:5901 in the vnc client
I have tried
iptables -A FORWARD -p tcp -i ethi --dport 5901 -s $192.168.1.2 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p-tcp --dport 5901 -j DNAT --to 192.168.1.2:5900
This does not work. I have googled a whole lot but all examples show redirect to the local machine.
Is this possible.
Thanks in advance