Port forward on Windows 7 / Windows 2008

Recently, a friend of mine asked me for help with the following situation:

  • Wifi network: 192.168.0.*
  • Laptop computer running Windows: 192.168.0.10 (wireless)
  • Gaming console without a a wireless adapter

The console was too far from his Access Point and he couldn’t run cables thoughout his house. He needed to connect to the gaming console from any computer on the wifi network.

He didn’t want to buy additional hardware, like another Access Point, or a wireless adapter for the console.

The obvious solution was to connect the laptop to the console with a cable and do a port forward from the wireless interface of the laptop to the console.

  • Laptop wireless interface: 192.168.0.10
  • Laptop wired/ethernet interface: 192.168.1.10
  • Console wired/ethernet interface: 192.168.1.20

After setting up the IP addresses, the only thing left to do was to set up the port forward on Windows. This can be easily accomplished with the built-in portproxy:

Click on Start and select Run, type cmd.exe but do NOT hit the “Enter” key. Press CTRL+SHIFT+ENTER instead. This way cmd.exe will be run with Administrator privileges.

At the command prompt, enter the following command:

netsh interface portproxy add v4tov4 listenport=7142 connectaddress=192.168.1.20 connectport=7142 listenaddress=192.168.0.10 protocol=tcp

In this case, I only needed to forward port 7142. If you need to forward multiple ports just repeat the above command for each port.

After running this command I was able to connect to the console from the wifi network using 192.168.0.10:7142 as the destination IP address/port.

Caveat: portproxy only supports TCP! If you need to proxy udp ports as well, you might want to look into sudppipe.

Alternative solutions:

Share

Leave a Reply