Windows Server 2012 Port Forward for Specifc Host

34,724

Solution 1

You'll need to use the console:

netsh interface portproxy add v4tov4 listenport={number outside} connectport={port inside} connectaddress={127.0.0.1/destination IP}

Sources:

https://social.technet.microsoft.com/Forums/windows/en-US/417fcbcd-169d-4f7a-8f3a-7a00a91bad66/windows-2012-firewall-port-forwarding?forum=winservercore

https://technet.microsoft.com/en-us/library/cc731068(v=ws.10).aspx

Solution 2

Yes. Yes you can. Take a look at the rule scope, specifically look for the section titled: "Which remote IP address does this rule match"

DO IT! DO IT NOW!

From there it's trivial to make the firewall action do what you want by forwarding that client to another port.

Share:
34,724

Related videos on Youtube

jjross
Author by

jjross

Just starting to learn some web technologies including JSF, jQuery, jQueryUI, and Primefaces.

Updated on September 18, 2022

Comments

  • jjross
    jjross over 1 year

    I am trying to have a specific host be redirected to another port when trying to access a service on port 80.

    So, when the client (192.168.1.22) requests a connection to the server (192.168.1.10) on port 80 I would like the server to redirect the request to another port (9080).

    Is this something that can be done? I can do it with a custom firewall rule in Linux (iptables) but I need to do this with Windows.

    So, client connects to port 80 on the server and is redirected to port 9080. All other clients connect per usual (port 80).

  • jjross
    jjross over 9 years
    That doesn't actualyy appear to work. If you specify a different external and internal port they don't forward. Unless you managed to get it to work?
  • Wesley
    Wesley over 9 years
    @jjross Yep, it's just a basic port forwarding rule. Something else must be messed up somewhere. You might want to use NetworkMonitor to track down where the packets are going.
  • Jacob
    Jacob over 9 years
    Can you elaborate on what "trivial" is to configure actions in windows based off a fw block/allow? I can't think of anyway to do what the OP is asking. Unfortunately win fw < iptables when it comes to that kind of flexibility.
  • Martin Erlic
    Martin Erlic about 7 years
    This doesn't work for me either.