Can the Windows Firewall forward a request for one port number to hit a service listening on a different port?

2

1

Can you set the Windows Firewall to modify an incoming port number?

For example, say I have a web server that listens on ports 80 and 443. I also have two different versions of a program... one that makes requests on the regular 80 and 443 ports, and an older version that makes requests on the non-standard 7080 and 7443 ports. I need to support both versions of the program from the same installed web server.

I would like to have a firewall rule in Windows to forward incoming traffic on port 7080 and 7443 to ports 80 and 443. Other firewalls can do this, but it doesn't seem possible from the interface. I'm hoping I can write more complex rules directly to whatever store Windows is using, or that I missed something simple in the normal user interface.

For the sake of academics, I'm interested if this is possible for any version of Windows (both client and server editions) running at least Windows 7. Let's also pretend that putting a simple firewall appliance in front the server is not possible (or at least highly undesirable) in this case.

Joel Coehoorn

Posted 2015-06-12T02:19:08.770

Reputation: 26 787

Possible dup of port forwarding in windows

– DavidPostill – 2015-06-12T07:28:19.860

This is different than the proposed duplicate. The other question involves routing across multiple network cards. This is entirely within the firewall. – Joel Coehoorn – 2015-06-12T16:54:16.593

Are your "programs" sending request from the internet? Or from within the same LAN? If you are trying to reach your server from the Internet, assuming that you have a router in front of the server, you can just configure Port Fowarding on the router? Something like: - WAN-IP:80 fowarded to LAN-IP:80

  • WAN-IP:7780 forwarded to LAN-IP:80 Should be able to do this on most routers? If you are using IIS, I believe you can choose to bind the Web Server to different IP address/ports too?
  • < – red – 2015-06-12T03:44:48.303

Answers

2

I'm not aware of any GUI application allow you to configure it.

If you don't mind using command line to set it, see if "netsh interface portproxy add" works for you.

To use it, run "netsh" over elevated command prompt, type "interface portproxy" to switch the context and then "add ?" or "add v4tov4 ?" to show the syntax needed.

Note that it requires the network card have IPv6 enabled in order to work.

cheong00

Posted 2015-06-12T02:19:08.770

Reputation: 39