Windows server 2003 local port redirect

portwindows-server-2003

Short: Can I configure windows server 2003 to accept traffic on port 30005 and redirect it to port 3333 on the same machine.

Long: I have a service listening for TCP on port 3333. This is a 3rd party service that does not seem to be configurable to listen on more than one port. Is there a way in windows to have all traffic sent on a different port, say 30005, to 3333. This is over a local lan so NATing in the router wont work. I have seen some answers that use iptables in linux but not able to find an answer for windows. As far as I can tell Netsh doesnt do what I need as it just allows or disallows traffic without routing it.

Best Answer

I've found the NAT abilities of Server 2003 and erlier to be limited compared to iptables. One way to accomplish on server 2003 is to use the Windows firewall.

Enable "Routing and Remote Access". Select IP routing>>NAT/Basic Firewall. Select your interface go to the "Services and Ports" tab. Define a service with ingoing and outgoing ports as needed. You can even add a 2nd IP addrses to your existing interface if needed to act as the "private address".

EDIT: To add a guide with pictures to the answer, here's a link.