PortProxy

From SixXS Wiki
Jump to: navigation, search

Recent versions of Microsoft Windows (tested on XP and Vista) have possibility to remap some IPv4 or IPv6 TCP service to another TCP port. Once the connection is made to one port on the local machine, this connection can be forwarded using the same or another protocol to the specified port number on the same or different machine.

This allows, for example, to run IPv4-only services like Windows Terminal Service over IPv6 on your Windows machine.

The simplest example is:

  netsh interface portproxy add v6tov4 3389

This command allows the user to connect to the TCP port 3389 (Remote Desktop Protocol, used by Terminal Services) over IPv6 and the connection will be forwarded to the localhost port 3389 over IPv4. In this way, one can connect remotely to the Windows machine over the IPv6 network.

The open-source Remote Desktop Protocol client, rdesktop, already supports IPv6.

You can also change the port number:

  netsh interface portproxy add v6tov4 listenport=3333 connectport=3389

This will open the TCP port 3333 over IPv6 for the incoming connections and forward them to the Terminal Services port 3389 over IPv4.

To delete the mapping use:

  netsh interface portproxy delete v6tov4 listenport=3333 connectport=3389

One can also display all active IPv6 to IPv6 mappings:

  netsh interface portproxy show v6tov4 

All commands (including ipv6-to-ipv6, ipv4-to-ipv4 mappings etc.) are described in the Microsoft Technet article.

References