Pcornel
Windows

IP Configuration

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

Back to the Topic

Answer

IP configuration on Windows sets each interface's address, mask, gateway and DNS servers, via DHCP or statically. Check it with ipconfig /all or Get-NetIPConfiguration and change it with netsh or New-NetIPAddress.

Remember

  • 169.254.x.x means DHCP failed.
  • Only one default gateway per machine normally.
  • Static settings override DHCP.

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

Commands

Get-NetIPAddress
Display IP addresses of Windows interfaces.
New-NetIPAddress
Assign a static IP address to a Windows interface.
Get-NetIPConfiguration
Adapter IP, gateway and DNS configuration.
ipconfig
Display IP configuration of Windows network adapters.

Verify in this order

interface → address source → gateway → DNS → metric

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=3074

Confirmation

Confirm action

Continue?