Troubleshooting network latency, routing traffic across multiple network adapters (such as concurrent Wi-Fi and Ethernet connections), and diagnosing split-tunnel virtual private network (VPN) configurations on Windows 11 requires auditing the operating system’s IP routing table. Historically, network engineers relied on legacy Command Prompt utilities like route print and netsh. However, modern Windows management is built on PowerShell’s NetTCPIP module. The native Get-NetRoute cmdlet provides a robust, object-oriented framework for querying, filtering, and modifying IPv4 and IPv6 destination prefixes, interface metrics, and next-hop gateway paths.
Understanding the Windows IP Routing Table and Get-NetRoute
Every IP packet transmitted by Windows 11 consults the kernel’s routing table to determine which network adapter to egress through and which next-hop router should receive the packet. The Get-NetRoute cmdlet queries the TCP/IP stack directly, returning structured objects with key properties:
- DestinationPrefix: The target IP subnet in Classless Inter-Domain Routing (CIDR) notation (e.g.
192.168.1.0/24or0.0.0.0/0for the default IPv4 gateway). - NextHop: The gateway IP address responsible for forwarding packets toward their destination. Local subnet routes typically display
0.0.0.0(on-link). - InterfaceAlias & InterfaceIndex (ifIndex): The friendly name (e.g. Ethernet or Wi-Fi) and unique numeric identifier of the physical or virtual adapter bound to the route.
- RouteMetric & InterfaceMetric: The cost assigned to the route. Windows automatically selects the route with the lowest combined metric when multiple adapters provide paths to the same destination.
- Protocol: Indicates how the route was populated (such as
NetMgmt,DHCP, orLocal).
How to View the Active IP Routing Table in PowerShell
To view your active routing table, launch PowerShell as an Administrator: press Win + X and select Terminal (Admin) or PowerShell (Admin).
Execute the basic command to output all registered IP routes:
Get-NetRoute
Because the default command lists every loopback, multicast, and link-local IPv6 route, the output can be voluminous. You can filter the results down specifically to standard IPv4 routes using the -AddressFamily parameter:
Get-NetRoute -AddressFamily IPv4 | Format-Table DestinationPrefix, NextHop, InterfaceAlias, RouteMetric, ifIndex -AutoSize
Identifying the Default Gateway and Internet Egress Route
To inspect your current default gateway—the primary path through which all external internet traffic flows—filter for the 0.0.0.0/0 destination prefix:
Get-NetRoute -DestinationPrefix "0.0.0.0/0"
If your Windows 11 computer is connected to both a wired Ethernet cable and an active Wi-Fi network, you may observe two separate default routes. In this scenario, examine the RouteMetric and interface metric values. Windows routes outbound traffic through whichever interface possesses the lowest total metric. You can verify adapter priority by piping the query into Sort-Object:
Get-NetRoute -DestinationPrefix "0.0.0.0/0" | Sort-Object RouteMetric
Filtering Routes by Network Adapter
When auditing VPN tunnel performance or verifying whether a secondary network interface is communicating properly, you can isolate routes associated with a specific adapter using the -InterfaceAlias or -InterfaceIndex parameter:
Get-NetRoute -InterfaceAlias "Wi-Fi" | Format-Table DestinationPrefix, NextHop, RouteMetric
Alternatively, if you know the adapter’s index number (which can be obtained by running Get-NetAdapter), specify:
Get-NetRoute -InterfaceIndex 12
How to Add a Static Route Using New-NetRoute
If you need to direct traffic bound for a remote corporate subnet or local lab environment through a specific gateway, you can create a static route directly in PowerShell using the companion cmdlet New-NetRoute:
New-NetRoute -DestinationPrefix "10.50.0.0/16" -InterfaceAlias "Ethernet" -NextHop "192.168.1.254" -RouteMetric 10
To confirm that the new route has been committed to the kernel table, query the destination prefix immediately:
Get-NetRoute -DestinationPrefix "10.50.0.0/16"
Modifying and Removing IP Routes in PowerShell
If you need to alter the priority of an existing route—for example, lowering its metric so that traffic prefers Ethernet over Wi-Fi—use the Set-NetRoute cmdlet:
Set-NetRoute -DestinationPrefix "10.50.0.0/16" -InterfaceAlias "Ethernet" -RouteMetric 5
When a static route is no longer required or if an obsolete gateway creates routing conflicts, delete the route cleanly with Remove-NetRoute:
Remove-NetRoute -DestinationPrefix "10.50.0.0/16" -Confirm:$false
Exporting Routing Diagnostics to CSV or JSON for Network Audits
Because PowerShell cmdlets emit structured .NET objects rather than plain text streams, you can seamlessly export the complete routing state to a file for system baseline records or remote IT support:
Get-NetRoute -AddressFamily IPv4 | Select-Object DestinationPrefix, NextHop, InterfaceAlias, RouteMetric, Protocol | Export-Csv -Path "$env:USERPROFILE\Desktop\routing_table.csv" -NoTypeInformation
This automated export facilitates rapid comparison across fleet endpoints when diagnosing enterprise connectivity disruptions and VPN routing discrepancies.