> ## Content Index
> Fetch the complete content index at: https://www.filipkonopik.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# PowerShell: Get Default Gateway
- URL: https://www.filipkonopik.com/powershell-get-default-gateway/
- Published: 2026-07-26T08:41:21.000Z
- Updated: 2026-08-06T05:34:08.000Z
- Author: Filip Konopík
- Tags: Connectivity

Need to check a machine's default gateway - for network troubleshooting, documentation, or confirming router configuration? This one-liner pulls it straight from the system's routing table.

Prerequisites:

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

Quick Command:

```Powershell
Get-NetRoute -DestinationPrefix "0.0.0.0/0" | Select-Object NextHop, InterfaceAlias
```

Example Output:

```powershell
NextHop     InterfaceAlias
-------     --------------
10.211.55.1 Ethernet
```

📦

****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.

[Get the Complete Bundle for $39](https://gum.co/u/oczvkqdc?ref=filipkonopik.com)

How It Works:

- Get-NetRoute returns the full routing table - a list of every network path the system knows about, including local subnets, multicast ranges, and loopback routes.
- \-DestinationPrefix "0.0.0.0/0" filters that table down to just the default route - the entry that catches all traffic not covered by a more specific route, which is exactly what "default gateway" means.
- NextHop shows the actual gateway IP address traffic gets sent to, and InterfaceAlias shows which network adapter uses it.

Pro Tip:

If a machine has multiple network adapters, this may return more than one default route. Check InterfaceAlias to confirm which one is actually active for your connection.