Windows Server 2012 Port Forward for Specifc Host
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://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"
From there it's trivial to make the firewall action do what you want by forwarding that client to another port.
Related videos on Youtube
jjross
Just starting to learn some web technologies including JSF, jQuery, jQueryUI, and Primefaces.
Updated on September 18, 2022Comments
-
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 over 9 yearsThat 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 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 over 9 yearsCan 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 about 7 yearsThis doesn't work for me either.