Use this when assigning a fixed IP to a Windows machine.
Static IP
A static IP is an address set manually on a Windows interface instead of via DHCP, typical for servers. Configure it with New-NetIPAddress or the adapter properties, along with gateway and DNS servers.
Context & applicabilityCommon mistakes · platform/version boundaries
- Wrong prefix length (
/16instead of/24), making the host think remote hosts are local. - Forgetting DNS server settings (
Set-DnsClientServerAddress). - Running
New-NetIPAddresson an interface that still has DHCP enabled — disable DHCP first withSet-NetIPInterface -Dhcp Disabled. - Not documenting static addresses in IPAM.
Operational reference
Fast context before you go deeper.
Get-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv4Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
Get-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv4
Get-NetIPInterface -InterfaceAlias Ethernet | Select Dhcp
Get-DnsClientServerAddress -InterfaceAlias Ethernet
Dhcp Disabled and the expected PrefixOrigin Manual confirm the static configuration.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Choose an address outside DHCP pools.
- Set gateway and DNS servers along with the address.
- Record the address in IPAM.
Get-NetIPConfiguration— addresses, gateway and DNS per interfaceGet-NetAdapter— adapters, status and link speedGet-NetRoute -AddressFamily IPv4— routes and metricsTest-NetConnection <host> -Port <p>— ping, route and TCP port testipconfig /all— full IP configurationGet-NetIPInterface | Select InterfaceAlias,AddressFamily,Dhcp,InterfaceMetric— DHCP state and metric per interface
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Static IP configuration with PowerShell:
$if = 'Ethernet'
Set-NetIPInterface -InterfaceAlias $if -Dhcp Disabled
Get-NetIPAddress -InterfaceAlias $if -AddressFamily IPv4 -ErrorAction SilentlyContinue | Remove-NetIPAddress -Confirm:$false
Get-NetRoute -InterfaceAlias $if -DestinationPrefix 0.0.0.0/0 -ErrorAction SilentlyContinue | Remove-NetRoute -Confirm:$false
New-NetIPAddress -InterfaceAlias $if -IPAddress 10.0.10.20 -PrefixLength 24 -DefaultGateway 10.0.10.1
Set-DnsClientServerAddress -InterfaceAlias $if -ServerAddresses 10.0.0.53,10.0.0.54
Set-DnsClient -InterfaceAlias $if -ConnectionSpecificSuffix corp.example.com
Running this remotely on the interface you are connected through will drop your session — use a console or a scheduled script.
ReferenceConfiguration & state1 section · depth on demand
Configuration
New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 10.10.20.15 -PrefixLength 24 -DefaultGateway 10.10.20.1
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 10.10.0.10,10.10.0.11
Documented example, not captured output. If DHCP was enabled before, remove the old address first (Remove-NetIPAddress) or the command fails. Reserve static addresses outside the DHCP scope, or use DHCP reservations instead.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in IP Configuration → Static IP. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows-server/networking/ · confidence 94%