port forwarding in windows

WindowsWindows 7Portforwarding

Windows Problem Overview


I have two network board in my pc:

The main one has the local ip -> 192.168.1.111 The secondary ones has the local ip -> 192.168.0.200

The main one has internet connection and the second one is connected to a device with the IP 192.168.0.33, it has a http server in port 80.

I have an apache-server in the main connection (port 4422), and I can access from anywhere, what I want now is when I detect a connection from 4422 i want to redirect this connection to 192.168.2.33:80

How can I do this with windows?

Windows Solutions


Solution 1 - Windows

I've solved it, it can be done executing:

netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33

To remove forwarding:

netsh interface portproxy delete v4tov4 listenport=4422 listenaddress=192.168.1.111

Official docs

Solution 2 - Windows

nginx is useful for forwarding HTTP on many platforms including Windows. It's easy to setup and extend with more advanced configuration. A basic configuration could look something like this:

events {}

http {
     server {
         
		listen 192.168.1.111:4422;

		location / {
			proxy_pass http://192.168.2.33:80/;
		}
     }
}

Solution 3 - Windows

I've used this little utility whenever the need arises: http://www.analogx.com/contents/download/network/pmapper/freeware.htm

The last time this utility was updated was in 2009. I noticed on my Win10 machine, it hangs for a few seconds when opening new windows sometimes. Other then that UI glitch, it still does its job fine.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser1256477View Question on Stackoverflow
Solution 1 - Windowsuser1256477View Answer on Stackoverflow
Solution 2 - WindowsJonas LundgrenView Answer on Stackoverflow
Solution 3 - WindowsvoonView Answer on Stackoverflow