Sometimes you run a program on your Windows computer that binds it’s ports to only the localhost address (127.0.0.1). Usually you can configure the program to also bind to other interfaces. But sometimes you can’t reconfigure it or you don’t find the configuration options, because it’s poorly documented. In some situations there are also good security reasons why the program only binds to the localhost. So I also have to tell you:
Make a local port available on a public interface
Let’s assume there is a service running on 127.0.0.1:12345 and you want to make it available to other computers in the network. First you have to find out the address that your computer has in the network you want to make the local port accessible to.
You can find it out with ipconfig
> ipconfig .... Ethernet-Adapter Ethernet xxx: ... IPv4-Adress . . . . . . . . . . . : 192.168.178.23 ... ....
In the example above my computer has the address 192.168.178.23.
Now I can add a port forwarding, let’s say from port 192.168.178.23:54321 to 127.0.0.1:12345 by executing the following netsh command in a command prompt with administrator priviledges.
netsh interface portproxy add v4tov4 listenport=54321 listenaddress=192.168.178.23 connectport=12345 connectaddress=127.0.0.1
I can also remove the port forwarding using
netsh interface portproxy delete v4tov4 listenport=54321 listenaddress=192.168.178.23
If you don’t know the ports that are forwarded you can also list all.
netsh interface portproxy show v4tov4