View interface IP settings and metrics on Windows (Get-NetIPInterface)
See per-interface DHCP state, automatic metrics and MTU — the layer between adapters and IP addresses that explains why traffic leaves one NIC.
01Command
$ Get-NetIPInterface -AddressFamily IPv4 | Sort-Object InterfaceMetric | Format-Table InterfaceAlias,InterfaceMetric,Dhcp,ConnectionState -AutoSize02What it does
Windows picks which NIC handles traffic by the lowest InterfaceMetric, and Get-NetIPInterface is the forgotten cmdlet that reveals those numbers — invaluable when a VPN steals the default route. Set-NetIPInterface lets you adjust -InterfaceMetric or disable router discovery per interface. It is the modern replacement for 'netsh interface ipv4 show interfaces'.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Get-NetIPInterface | Microsoft LearnEvidence: Microsoft documents Get-NetIPInterface as retrieving IP interface properties including InterfaceMetric, Dhcp, NeighborDiscovery and MTU settings.
Last verified: 2026-09-17 · Category: Network
06Related solutions
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.
The PowerShell-native replacement for netstat: filter connections by state, port, or process and pipe results instead of parsing text.
See every route Windows knows — gateway, interface, and metric — to figure out why traffic goes out the wrong adapter or VPN tunnel.