Port forwarding is built into Windows 10, but it isn’t visible in the Settings interface. When working on a LAN (local area network) or developing with web servers, port forwarding allows you to access network resources as if they were hosted on your local machine.
How to configure port forwarding on a Windows 10 PC
We’ll show you how to create your own port forwarding rule in this guide. We’ll add a rule that routes the address “http://127.0.0.1:9000” to “http://192.168.0.10:80″ for the purposes of this guide. You can then go to “http://127.0.0.1:9000” in a browser to see what you would have seen if you went directly to “http://192.168.0.10:80.”
Using the command prompt to add the rule is required. You’ll also need to log in as an administrator. To begin, go to the Start menu and type “cmd.” To open Command Prompt as an administrator, click the first search result while holding down the Control and Shift keys.
After that, you’ll configure the port-forwarding rule with the “netsh” command. Because it’s a long command, make sure you type it exactly as shown below.
netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=9000 connectaddress=192.168.0.10 connectport=80
Take note of how the values for “listenaddress,” “listenport,” “connectaddress,” and “connectport” match the ones we mentioned earlier. To fit the rule you’re adding, you’ll need to make some changes here. If you want to route to port 8888 on a device with IP 192.168.0.1, for example, use these values for the “connectport” and “connectaddress” parameters.
When you press enter, the rule is immediately added and applied. In your browser, go to the listening address and port, and you should see the content served by the connect address and port.
When you’re ready to get rid of the rule, go to an administrator command prompt and type the following command:
netsh interface portproxy delete v4tov4 listenaddress=127.0.0.1 listenport=9000
You’ll need to change the listening address and port to match the values you’re using once more. The rule will be removed immediately, and new network requests will no longer be affected.
People also ask
No Responses