Pcornel
Windows · IP Configuration

Interface Metrics

Cheat sheet · https://pcornel.dk/topic.php?topic=3079

Back to the Topic

Answer

Interface metrics rank network interfaces so Windows prefers the lowest-cost one, for example wired over Wi-Fi. Automatic metric uses link speed; set a fixed value with Set-NetIPInterface -InterfaceMetric.

Remember

  • The interface with the lowest metric is preferred.
  • Automatic metric is based on link speed.
  • A fixed metric overrides the automatic one.

First checks

  • Get-NetIPConfiguration — addresses, gateway and DNS per interface
  • Get-NetAdapter — adapters, status and link speed
  • Get-NetRoute -AddressFamily IPv4 — routes and metrics
  • Test-NetConnection <host> -Port <p> — ping, route and TCP port test
  • ipconfig /all — full IP configuration
  • Get-NetIPInterface | Select InterfaceAlias,AddressFamily,Dhcp,InterfaceMetric — DHCP state and metric per interface

Verify in this order

interface metric + route metric → lowest total wins

Where it usually breaks

First mismatch in host/interface identity → local config/routing/name state → Windows service/provider → firewall/security/session → remote service → application-visible exchange; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3079

Confirmation

Confirm action

Continue?