2 September 2026 Updated: 25 October 2026 9 min read

Port Forwarding with netsh portproxy: Access Internal Services Through a Jump Host

Windows includes built-in TCP port forwarding with netsh interface portproxy. Combined with a VPN such as Tailscale, this lets you access an internal service, such as a NAS interface, from outside without exposing it publicly. Learn how to set up, secure, and remove the forwarding, as well as its limitations: no UDP, no additional encryption, and certificate and redirect pitfalls.

An internal service often listens only on the local network: a NAS web interface, a printer panel, or an administration page. If you want to access it from outside without putting the service on the internet, you need a path through a computer that can see both sides. Windows includes a built-in tool for this: netsh interface portproxy forwards incoming TCP connections to another destination. Combined with a VPN such as Tailscale or WireGuard, a computer on the target network becomes a jump host through which you can access the internal service.

A concrete example: A NAS with its web interface at 10.0.0.245:5000 is accessible only on the local network. A Windows PC on the same network is also reachable through a VPN. Set up port forwarding on this PC from its VPN address to the NAS, then open the NAS interface in the browser through the PC’s VPN address. The service remains on the internal network; only the jump host is reachable through the VPN.

How portproxy works

portproxy is part of the IP Helper service (iphlpsvc). The service accepts connections on a local port and forwards them to a destination. It is a pure TCP relay at the application layer: not a firewall NAT rule, but a process that copies bytes between two connections. If iphlpsvc is not running, no forwarding works. The service is available by default; its startup type should be set to automatic if the forwarding is to survive a restart.

Setup

Forwarding requires two steps: the portproxy rule and a firewall rule that allows access to the listener. Run both in a Command Prompt or PowerShell with administrator privileges.

First, create the forwarding rule. It binds to a local address and port and points to a destination IP and destination port:

netsh interface portproxy add v4tov4 listenaddress=100.100.10.10 listenport=5000 connectaddress=10.0.0.245 connectport=5000
Options explained
OptionEffect
v4tov4IPv4 listens, IPv4 connects; also possible: v4tov6, v6tov4, v6tov6
listenaddressLocal address to listen on; here, the jump host’s VPN address, so incoming connections are accepted only through the VPN
listenportLocal port to listen on
connectaddressDestination IP to forward to (the internal service)
connectportDestination port on the internal service

Binding to the VPN address rather than 0.0.0.0 is the first security measure: the listener appears only on the VPN interface, not on all network adapters of the jump host. The second security measure is the firewall. Open the listener port exclusively for your VPN’s address range, not for all addresses:

New-NetFirewallRule -DisplayName "NAS-Proxy (VPN)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5000 -RemoteAddress 100.64.0.0/10
Options explained
OptionEffect
-Direction InboundRule for incoming traffic
-Protocol TCPportproxy forwards TCP only, hence TCP
-LocalPort 5000The listener port from the portproxy rule
-RemoteAddress 100.64.0.0/10Only sources from this range are permitted; here, the Tailscale range, otherwise your VPN’s CIDR block

Verify and use

First, check on the jump host itself whether the internal service is reachable at all, and display the active forwarding rule:

Test-NetConnection -ComputerName 10.0.0.245 -Port 5000
netsh interface portproxy show v4tov4

If the destination responds and the rule appears in the list, test it from your remote device. The service is now reachable through the jump host’s address and port:

Test-NetConnection -ComputerName 100.100.10.10 -Port 5000

Then open http://100.100.10.10:5000 in your browser. If you need multiple ports for the same service, such as 5000 and 5001 for HTTP and HTTPS, create a separate portproxy rule and the corresponding firewall exception for each port.

Man page-style overview

The most important subcommands of netsh interface portproxy:

Options at a glance
CommandPurpose
add v4tov4 …Create forwarding (listenaddress/listenport → connectaddress/connectport)
show v4tov4Display active IPv4 forwarding rules
show allDisplay all forwarding rules for all protocol variants
delete v4tov4 listenaddress=… listenport=…Remove a forwarding rule
resetDelete all portproxy rules

The rules are stored in the registry under HKLM\SYSTEM\CurrentControlSet\Services\PortProxy and persist across restarts. They are visible only through netsh or directly in the registry, not in the graphical firewall interface.

Alternatives

portproxy is useful if the jump host is already running Windows and you do not want to install anything else. Two alternatives solve the same problem with different characteristics.

An SSH tunnel with local forwarding (ssh -L 5000:10.0.0.245:5000 benutzer@jumphost) encrypts the connection to the jump host itself and works across platforms. It requires an SSH server on the jump host and exists only as long as the SSH session remains active.

A Tailscale subnet router (tailscale set --advertise-routes=10.0.0.0/24) makes the entire internal subnet reachable for your VPN devices. You then address the internal service directly at its actual IP, without forwarding each port individually. This is the most straightforward approach if you want to access multiple internal devices, but it requires approving the route in the Tailscale administration console.

Limitations

Port forwarding with portproxy solves the access issue, but it has clear limitations you should know before using it:

  • TCP only. portproxy forwards TCP exclusively. Services that require UDP (DNS, many VPN and gaming protocols, and some video streaming) cannot be implemented this way.
  • No additional encryption. The forwarding copies bytes unchanged. The VPN through which you access the jump host alone provides confidentiality for the connection. Traffic would be unprotected over an unencrypted transport network.
  • Certificate warning for HTTPS through the IP address. If you forward an HTTPS service and access it through the jump host’s IP address, the destination certificate does not match the address being accessed. The browser displays a warning. This may be acceptable for a brief test, but not for ongoing use.
  • Redirects and absolute addresses. Some web interfaces redirect to their hostname or another port themselves, or create absolute links using their internal address. In that case, access through the jump host fails even though the forwarding is in place. Such services need a real reverse proxy rather than a pure port relay.
  • Binding to an address that must exist at startup. If the rule binds to a specific listenaddress, that address must be present when the service starts. If the VPN interface comes up later, binding can fail until the service is restarted or the rule is added again.
  • An additional path into the internal network. Every forwarding rule is a path from outside to an internal service. Restrict the firewall tightly to the VPN range, bind to the VPN address, and remove the forwarding as soon as you no longer need it.

Remove it again

After you are done, delete the forwarding rule and the firewall rule:

netsh interface portproxy delete v4tov4 listenaddress=100.100.10.10 listenport=5000
Remove-NetFirewallRule -DisplayName "NAS-Proxy (VPN)"

Port forwarding is a tool for targeted, time-limited access, not for a permanently open channel. For ongoing access to an internal service over the internet, a reverse proxy with a valid certificate or a VPN with subnet routing is the cleaner solution.

Change log

  • October 25, 2026: Corrected: Subnet routes are advertised with tailscale set —advertise-routes instead of tailscale up. Updated source links to the new Microsoft Learn and Tailscale addresses.

Sources

  1. netsh interface (Microsoft Learn)

    Command reference for netsh interface with the syntax of the portproxy subcommands and protocol variants.

    https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netsh-interface
  2. New-NetFirewallRule (Microsoft Learn)

    Parameters for the firewall rule, including restriction to address ranges through RemoteAddress.

    https://learn.microsoft.com/en-us/powershell/module/netsecurity/new-netfirewallrule?view=windowsserver2025-ps
  3. Tailscale: Subnet routers

    Make an entire subnet reachable through the VPN as an alternative to forwarding each port; routes are advertised with tailscale set --advertise-routes.

    https://tailscale.com/docs/features/subnet-routers

Comments

Comments are loaded from GitHub / Giscus.