Port forwarding on Windows Server 2008 R2

To forward a port on Windows Server 2008 R2 enter the following in command prompt.

For example, if you run a webserver on 192.168.0.2, but the computer 192.168.0.1 is the router.

netsh interface portproxy add v4tov4 listenport=80 listenaddress=192.168.0.1 connectport=80 connectaddress=192.168.0.2

listenport= portnumber for the incoming traffic/listen
listenaddress= the local ip of the computer which listens/public
connectport= portnumber to connect to/service
connectaddress= computer that runs the service

Sidebar