☕ Buy a Coffee
Home / Windows & SysAdmin

Setup a Static IP Address for a Local Server

Prevent IP address conflicts and ensure stable port-forwarding and SSH accessibility by assigning fixed static IPv4 network configurations.

Sachin Siju
Sachin Siju
Lead Systems Engineer & Tech Blogger
Jul 27, 2026 4 min read
Setup a Static IP Address for a Local Server

Why DHCP Isn't Good Enough for a Server

By default your router hands out addresses dynamically via DHCP, leasing an IP to each device for a fixed period and reassigning it later — possibly to a different device — once the lease expires. That's fine for phones and laptops that move around, but it's a problem for anything you depend on having a fixed address: a home server, a NAS, a Plex box, or anything you SSH into or forward router ports to. If the DHCP lease renews and the device gets handed a different IP, your port forwards silently start pointing at nothing and your SSH shortcuts stop connecting. Pinning the address solves this permanently.

There are two ways to do it: configure a static IP directly on the server's network adapter, or configure a DHCP reservation on the router that always hands that device the same address. The reservation approach is generally the better one — it keeps all your IP assignments visible and managed in one place — but both are covered here.

Before You Start: Pick an IP Outside the DHCP Pool

Check your router's DHCP settings (usually under LAN or DHCP Server in the admin panel) to see its lease range — commonly something like 192.168.1.100 to 192.168.1.200. Choose an address outside that range, such as 192.168.1.50, so the router can never accidentally hand your chosen IP to a different device. You'll also need your subnet mask (almost always 255.255.255.0 on a home network), your default gateway (your router's IP, e.g. 192.168.1.1), and a DNS server (your router's IP again, or a public resolver like 1.1.1.1).

Method 1: Static IP via Windows Settings

  1. Open Settings → Network & Internet, then click your active connection (Ethernet or Wi-Fi).
  2. Under IP assignment, click Edit.
  3. Change the dropdown from Automatic (DHCP) to Manual.
  4. Toggle IPv4 on and fill in:
    • IP address: the address you chose, e.g. 192.168.1.50
    • Subnet mask: 255.255.255.0
    • Gateway: your router's IP, e.g. 192.168.1.1
    • Preferred DNS: 192.168.1.1 or 1.1.1.1
  5. Click Save.

Method 2: Static IP via netsh (Scriptable)

If you're setting this up on a headless server or want it reproducible, do it from an elevated Command Prompt. First find the exact adapter name:

netsh interface show interface

Then assign the static configuration, substituting your own values and adapter name:

netsh interface ip set address name="Ethernet" static 192.168.1.50 255.255.255.0 192.168.1.1
netsh interface ip set dns name="Ethernet" static 1.1.1.1

Method 3: DHCP Reservation on the Router (Recommended)

This achieves the same result without touching the server's own network settings at all — the server keeps requesting DHCP normally, and the router always answers with the same address because it recognizes the device's MAC address.

  1. Find the server's MAC address: on Windows, run ipconfig /all and look for Physical Address under the relevant adapter.
  2. Log into your router's admin panel (commonly 192.168.1.1 or 192.168.0.1 in a browser).
  3. Find DHCP Reservation, Address Reservation, or Static Leases — the naming varies by vendor but every consumer router has some version of this.
  4. Add a new reservation: paste the MAC address, assign your chosen IP (again, outside the dynamic pool, or the router may let you reserve within it — check your vendor's behavior), and save.
  5. Reboot the server, or release/renew its lease with ipconfig /release then ipconfig /renew (elevated Command Prompt), to pick up the reservation immediately.
Tip: DHCP reservation is generally preferable to a manually configured static IP because it keeps DNS and gateway settings centrally managed by the router — if you ever change your router or renumber your subnet, you only update one place instead of hunting down every device you hardcoded.

Verifying It Worked

Run ipconfig on the server and confirm the IPv4 Address matches what you configured. From another device on the network, confirm it's reachable and stable:

ping -t 192.168.1.50

Reboot the server once and check the address again — if it changed, the reservation or static config didn't take, and it's worth double-checking the MAC address you entered matches the actual adapter in use (not a virtual adapter if the machine runs Hyper-V or WSL, which each get their own MAC).

Wrap-Up

Either method gets you a stable address, but a DHCP reservation is the lower-maintenance choice for anything long-lived, since it survives OS reinstalls and network resets without reconfiguration. Once the address is locked in, your port forwards, SSH configs, and any hardcoded connection strings will keep working indefinitely instead of breaking every time a lease renews.

Featured Infrastructure Partner

Deploy on High-Performance Hostinger Cloud

Get up to 75% OFF + free domain & SSL. Powering xube.me's sub-second response times.

Claim Discount ↗

Discussion & Insights

Related Technical Essays