PowerShell: Get the Routing Table

Need to see the full routing table - for network troubleshooting, understanding how traffic is directed, or documenting network configuration? This one-liner pulls it straight from the system.

Prerequisites:

  • Privileges: None
  • Module: Built-in, no import needed

Quick Command:

Get-NetRoute | Select-Object DestinationPrefix, NextHop, InterfaceAlias, RouteMetric

Example Output:

DestinationPrefix             NextHop     InterfaceAlias   RouteMetric
-----------------             -------     --------------   -----------
255.255.255.255/32            0.0.0.0     Ethernet                 256
224.0.0.0/4                   0.0.0.0     Ethernet                 256
192.168.1.0/24                0.0.0.0     Ethernet                 256
0.0.0.0/0                     192.168.1.1 Ethernet                   0
fe80::/64                     ::          Ethernet                 256
::1/128                       ::          Loopback Pseudo-Interface 1  256
📦
Want all of them at once?
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.

How It Works:

  • Get-NetRoute returns every route the system knows about, across all network adapters - local subnet routes, multicast ranges, loopback, IPv6 link-local addresses, and the default route, all in one table.
  • DestinationPrefix shows the network range a route applies to - 0.0.0.0/0 is the default route (catches everything not covered elsewhere), while entries like 192.168.1.0/24 cover a specific local subnet.
  • NextHop shows where traffic gets sent for that route - 0.0.0.0 means the destination is directly reachable on the local network, while an actual IP (like 192.168.1.1) means traffic goes through that gateway.
  • RouteMetric shows the route's priority - lower numbers are preferred when multiple routes could apply.