How to Enable IPv4 and IPv6 Packet Forwarding in Windows 11 Using PowerShell

In advanced home lab environments, isolated testing networks, and multi-homed enterprise workstations, administrators frequently need a Windows 11 PC to route network packets between disparate network subnets. For instance, developers running isolated Hyper-V virtual switches, Docker containers, or secondary Ethernet networks connected to embedded hardware often require the host machine to route traffic between those private networks and the primary corporate LAN or internet gateway without deploying dedicated hardware routers.

By default, Windows 11 acts strictly as an end-node host: incoming packets whose destination IP address does not match one of the local machine’s configured IP addresses are immediately discarded by the TCP/IP stack. To transform Windows 11 into a multi-homed software router, administrators must enable IP packet forwarding. Using the native PowerShell NetTCPIP module and the Set-NetIPInterface cmdlet, administrators can enable IPv4 and IPv6 packet forwarding on specific network adapters, configure weak host routing models, and manage static routing tables. This guide covers how to inspect forwarding states, enable dual-stack routing, and troubleshoot network traversal issues in Windows 11.

Understanding IP Forwarding and Routing in Windows 11

The Windows TCP/IP networking stack manages routing decisions through interface-level properties and routing tables:

  • Forwarding: Dictates whether the network interface will forward transit packets. When set to Enabled, if the interface receives a packet destined for a foreign subnet, the Windows IP router checks the local routing table and forwards the packet out of the appropriate egress network interface.
  • Per-Protocol Control: Forwarding is configured independently for IPv4 and IPv6 families using the -AddressFamily parameter. This allows administrators to enable modern IPv6 routing while keeping IPv4 traffic strictly isolated.
  • Weak Host Routing Integration: Windows utilizes a “strong host” routing model by default, dropping incoming packets on one interface if the destination IP is bound to another interface. When enabling forwarding, pairing it with WeakHostSend and WeakHostReceive ensures packets traverse multi-homed interfaces smoothly.
  • Static Routing Table: The Windows routing engine references persistent routes added via New-NetRoute to determine next-hop gateway addresses for foreign destination subnets.

Inspecting Current IP Forwarding Status on Network Interfaces

To inspect the forwarding configuration across all network adapters, open an elevated PowerShell console (Run as Administrator) and execute Get-NetIPInterface:

# Query forwarding status for all IPv4 and IPv6 network interfaces
Get-NetIPInterface | Select-Object InterfaceAlias, AddressFamily, Forwarding, WeakHostSend, WeakHostReceive

The console displays the active state of each interface:

InterfaceAlias              AddressFamily  Forwarding  WeakHostSend  WeakHostReceive
--------------              -------------  ----------  ------------  ---------------
Ethernet                    IPv4           Disabled    Disabled      Disabled
Ethernet                    IPv6           Disabled    Disabled      Disabled
vEthernet (InternalSwitch)  IPv4           Disabled    Disabled      Disabled
vEthernet (InternalSwitch)  IPv6           Disabled    Disabled      Disabled
Wi-Fi                       IPv4           Disabled    Disabled      Disabled

By default, Forwarding is set to Disabled across all physical and virtual network adapters.

Enabling IPv4 and IPv6 Packet Forwarding with Set-NetIPInterface

To enable software routing between two networks (for example, between physical "Ethernet" and the virtual switch "vEthernet (InternalSwitch)"), enable forwarding on both interfaces so packets can travel in both directions.

Enabling IPv4 Forwarding

To enable IPv4 packet routing across the primary Ethernet adapter and internal switch:

# Enable IPv4 forwarding on both interfaces
Set-NetIPInterface -InterfaceAlias "Ethernet" -AddressFamily IPv4 -Forwarding Enabled
Set-NetIPInterface -InterfaceAlias "vEthernet (InternalSwitch)" -AddressFamily IPv4 -Forwarding Enabled

Enabling IPv6 Forwarding

To enable IPv6 transit routing across the same network connections:

# Enable IPv6 forwarding on both interfaces
Set-NetIPInterface -InterfaceAlias "Ethernet" -AddressFamily IPv6 -Forwarding Enabled
Set-NetIPInterface -InterfaceAlias "vEthernet (InternalSwitch)" -AddressFamily IPv6 -Forwarding Enabled

To enable forwarding across all active network adapters on the system in a single command:

# Globally enable IPv4 and IPv6 packet forwarding across all network adapters
Get-NetIPInterface | Set-NetIPInterface -Forwarding Enabled

Configuring Weak Host Send and Receive for Multi-Homed Routing

When Windows 11 routes packets across multiple interfaces, the default “strong host” security model can cause asymmetric routing drops. Enable Weak Host Send and Weak Host Receive on both interfaces to ensure packets entering one interface can be processed and forwarded out of another without being discarded:

# Enable Weak Host Send and Receive on the routing adapters
Set-NetIPInterface -InterfaceAlias "Ethernet" -WeakHostSend Enabled -WeakHostReceive Enabled
Set-NetIPInterface -InterfaceAlias "vEthernet (InternalSwitch)" -WeakHostSend Enabled -WeakHostReceive Enabled

Configuring Static Routes for Destination Subnets

For forwarded packets to reach their final destination, Windows must know the next-hop gateway address. Add static routing entries using New-NetRoute:

# Add static route directing 10.10.0.0/24 traffic to next-hop gateway
New-NetRoute -DestinationPrefix "10.10.0.0/24" `
    -InterfaceAlias "vEthernet (InternalSwitch)" `
    -NextHop "10.10.0.1"

To verify the active routing table entries:

# Inspect active IPv4 routing table
Get-NetRoute -AddressFamily IPv4 | Select-Object DestinationPrefix, NextHop, InterfaceAlias, RouteMetric

Configuring Windows Defender Firewall for Transit Traffic

Even with IP forwarding enabled at the network stack level, Windows Defender Firewall inspects transit packets. By default, Windows Defender Firewall can drop routed packets unless an explicit rule permits forwarding.

To ensure routed traffic is not dropped by the firewall, create an inbound allow rule permitting forwarded transit traffic:

# Allow transit traffic across the internal routing subnet
New-NetFirewallRule -DisplayName "Allow-Routed-Transit-Traffic" `
    -Direction Inbound `
    -Action Allow `
    -RemoteAddress @("10.10.0.0/24", "192.168.1.0/24") `
    -Profile Private, Domain

Disabling IP Forwarding and Reverting to Host Mode

When testing is complete and the workstation should return to standard isolated host behavior, disable forwarding across all adapters:

# Disable packet forwarding and restore default host isolation
Set-NetIPInterface -InterfaceAlias "Ethernet" -Forwarding Disabled
Set-NetIPInterface -InterfaceAlias "vEthernet (InternalSwitch)" -Forwarding Disabled

Troubleshooting Common Packet Forwarding Issues

When setting up Windows 11 as a software router, keep these essential troubleshooting factors in mind:

  • Missing Reverse Route on Connected Clients: A common failure point in software routing is forgetting the return path. Devices on the private subnet may send packets through Windows successfully, but upstream corporate routers or default gateways must have a static route pointing back to the Windows machine’s IP address to route return packets.
  • IP EnableRouter Registry Setting: On certain enterprise Windows 11 builds, the TCP/IP stack requires the legacy IP routing registry key to be toggled in addition to PowerShell interface settings. To enable system-wide IP routing in the registry:
    # Enable IP routing in Windows registry
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "IPEnableRouter" -Value 1
    
    A system restart is required if modifying this registry key.
  • Network Address Translation (NAT): If devices on the private subnet need to reach the internet through a single public IP address on the primary Ethernet connection, simple forwarding is insufficient; you must also configure NAT using New-NetNat -Name "InternalNAT" -InternalIPInterfaceAddressPrefix "10.10.0.0/24".

Using Set-NetIPInterface -Forwarding Enabled provides systems administrators with a lightweight, flexible routing framework for interconnecting multi-homed network segments directly in Windows 11.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.