I do not know the structure of your network, but if your server is connected behind nat, you should configure the portforwarding directly on the router. However, if your server is directly accessible from the Internet this is the iptables rule that you should use:
Code: Select all
# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3389
(where eth0 is the network interface exposed to the internet and port 80 is the new port on which the server will listen as well as the old)
Remenber to check if packet forwarding is enabled:
Code: Select all
# cat /proc/sys/net/ipv4/conf/eth0/forwarding
1: enabled , 0: disabled
If enabled it is ok, else if it is disabled:
Code: Select all
# echo '1' > /proc/sys/net/ipv4/conf/eth0/forwarding
now is enabled, but not after reboot... If you want it after reboot enabled, you can edit /etc/sysctl.conf , for example a line with
enable a packet forwarding on all interfaces.
Do not forget that the iptables rules are deleted at restart of system. To do so they are restored automatically
save the current configuration:
and add the iptables init script at boot:
EDIT: I had forgotten that your server was running with windows... you can not use iptables on windows, then probably the solution above is useless! What you need to do is set up port forwarding on your router, that despite probably running Linux, it also provides a simpler interface for configuration!
If, however, as I already suggested, the windows computer is directly exposed on the internet, you could use another firewall such as
http://wipfw.sourceforge.net/ (on which I know nothing except its existence).