How to Set a Static IP Address on a PC

Follow these steps in order to set a static IP.

  1. When you actually need a static IP

    The IP address your router automatically assigns each device (via DHCP) can change after a reboot or over time. But devices that need to always be reachable at the same address β€” like a device with forwarded ports, a NAS you access remotely, a home server, or a shared network printer β€” will break every time that address shifts, so it is safer to give those specific devices a static IP.

  2. Check your current network settings first

    On Windows, run "ipconfig /all" in Command Prompt to see your current IP address, subnet mask, default gateway (your router's address), and DNS servers all at once. On a Mac, you can find the same information under System Settings > Network > Wi-Fi (or Ethernet) > Details. Reference these exact values when setting a static IP.

  3. Choose an address outside the DHCP range

    Check the automatic assignment range in your router's DHCP settings (for example, 192.168.0.100–192.168.0.200), then choose an address outside that range (for example, 192.168.0.50). This prevents your router from later handing that same address to another device and causing a conflict.

  4. Set a static IP on Windows

    Go to Settings > Network & Internet, click your active connection (Wi-Fi or Ethernet), find the edit button next to "IP assignment," switch it from "Automatic (DHCP)" to "Manual," turn on IPv4, then enter the IP address, subnet prefix length (usually 24), gateway, and DNS values you noted earlier, and save.

  5. Set a static IP on Mac

    In System Settings > Network, select your active connection and go to "Details," then under the TCP/IP tab switch "Configure IPv4" to "Manually" and enter the IP address, subnet mask, and router (gateway) values. DNS servers can be added separately under the DNS tab.

  6. Verify the change worked without conflicts

    After configuring it, confirm your internet connection still works, then ping the new static IP from another device to check that it responds correctly. If you see a warning icon on your connection or lose internet access, it usually means the gateway or subnet values you entered do not match your router's actual settings.

You can also reserve an IP from the router instead

Instead of configuring a device directly, your router's DHCP reservation feature can automatically hand out the same IP address every time to a device based on its MAC address. Check how to find that device's MAC address first if you want to go this route.

Pair it with port forwarding

Once a device has a static IP, you can use port forwarding to open a specific port on that device to the outside. Since the forwarding rule targets a specific address, that address needs to stay fixed first β€” otherwise you would have to redo the forwarding rule every time the IP changed.

Frequently Asked Questions

What is the difference between a router-side IP reservation and setting a static IP directly on the PC?

A router IP reservation still technically uses DHCP, but the router remembers to always hand a specific device the same address. Configuring a static IP directly on the PC means that device stops using DHCP entirely and fixes its own address. The router reservation is generally easier to manage, but knowing how to configure it directly on the PC is useful when you cannot access the router's settings page.

Will entering the wrong values break my internet completely?

Yes β€” entering a gateway or subnet mask that does not match your actual network can disconnect you from the internet. If that happens, simply switching back to "Obtain an IP address automatically (DHCP)" restores a normal connection immediately.