How to Assign a Static IP Address: Windows vs Linux for Network Configuration

Assign a static IP address only when a device must be found at the same address every time, such as a server, printer, camera, firewall, or workstation used for remote access. For ordinary laptops and phones, automatic addressing from the router is usually safer and easier. The goal is simple: pick an unused address, set the correct subnet mask, gateway, and DNS servers, then test the connection before users depend on it.

TLDR: Windows is easier for one-off static IP setup because the graphical settings are clear, while Linux is better for repeatable server configuration through files or terminal commands. For example, a small office with 24 devices might reserve static addresses for two printers, one NAS, and one camera recorder, while leaving the rest on automatic addressing. In one common support scenario, assigning fixed addresses to shared printers can cut “printer not found” tickets by 50% or more. Always check the router’s DHCP range first, or you may create an address conflict.

When a Static IP Makes Sense

A static IP address is a manually assigned network address. It does not change after reboot unless someone changes it. That makes it useful for services that other devices must locate reliably.

  • File servers: users connect to the same address or hostname every day.
  • Printers: print queues break less often when the printer address stays fixed.
  • Security cameras and NVRs: recording systems need stable camera paths.
  • Remote desktop machines: admins need predictable access.
  • Network gear: switches, firewalls, and access points should not move around the subnet.

The catch is that static settings are unforgiving. A single wrong digit in the gateway or subnet mask can make the machine appear broken. Worse, if two devices share the same IP address, both may suffer random dropouts that waste time and patience.

Before You Change Anything

Write down the current network details before editing settings. This gives you a clean rollback path if the device loses access.

  • IP address: the address you plan to assign, such as 192.168.1.50.
  • Subnet mask: often 255.255.255.0 on small networks.
  • Default gateway: usually the router, such as 192.168.1.1.
  • DNS servers: your router, internal DNS, or public DNS such as 1.1.1.1 or 8.8.8.8.
  • DHCP range: the pool used by the router for automatic addresses.

A safe practice is to place manually assigned addresses outside the router’s automatic pool. If the router assigns 192.168.1.100 through 192.168.1.200, choose something like 192.168.1.20 for a printer or 192.168.1.30 for a small server. Better still, document every static address in a shared spreadsheet or IP address management tool.

Assigning a Static IP in Windows

Windows offers two practical routes: the Settings app and PowerShell. The Settings app is fine for a single workstation. PowerShell is better for repeat tasks or careful documentation.

Method 1: Windows Settings

  1. Open Settings.
  2. Go to Network & Internet.
  3. Select Ethernet or Wi Fi, depending on the adapter.
  4. Open the active network connection.
  5. Find IP assignment and click Edit.
  6. Change the setting from automatic to Manual.
  7. Turn on IPv4.
  8. Enter the IP address, subnet prefix length, gateway, and DNS servers.
  9. Save the settings.

For a typical home or small office network, the subnet prefix length is often 24, which equals the subnet mask 255.255.255.0. This is one area where Windows can be mildly annoying. Older dialogs ask for a subnet mask, while newer ones ask for prefix length. Same concept, different wording.

Method 2: Windows PowerShell

Open PowerShell as an administrator. First, list adapters:

Get-NetAdapter

Then assign the address:

New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 192.168.1.50 -PrefixLength 24 -DefaultGateway 192.168.1.1

Set DNS servers:

Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 1.1.1.1,8.8.8.8

Test the result:

ipconfig
ping 192.168.1.1
ping example.com

If the gateway ping works but the website ping fails, the problem is likely DNS. If the gateway ping fails, check the IP address, cable, Wi Fi connection, subnet, or gateway.

Image not found in postmeta

Assigning a Static IP in Linux

Linux configuration depends on the distribution and network manager. Ubuntu Server commonly uses Netplan. Many desktop distributions use NetworkManager. Older systems may use interface files, but those are less common now.

Ubuntu Server with Netplan

Find the Netplan file:

ls /etc/netplan/

Edit the YAML file with care:

sudo nano /etc/netplan/01-netcfg.yaml

A basic static IPv4 example may look like this:

network:
  version: 2
  ethernets:
    enp0s3:
      addresses:
        - 192.168.1.60/24
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        addresses:
          - 1.1.1.1
          - 8.8.8.8

Apply it:

sudo netplan apply

Honestly, YAML spacing feels like it was designed to punish tired admins. One wrong indent can break the file. Use spaces, not tabs, and keep a backup before editing.

Linux with NetworkManager

On many desktop and server installations, nmcli is the cleanest route:

nmcli connection show

Then set the static address:

sudo nmcli connection modify "Wired connection 1" ipv4.addresses 192.168.1.60/24
sudo nmcli connection modify "Wired connection 1" ipv4.gateway 192.168.1.1
sudo nmcli connection modify "Wired connection 1" ipv4.dns "1.1.1.1 8.8.8.8"
sudo nmcli connection modify "Wired connection 1" ipv4.method manual
sudo nmcli connection up "Wired connection 1"

Check the result:

ip addr
ip route
resolvectl status
ping 192.168.1.1
ping example.com

Windows vs Linux: Key Differences

  • Ease of use: Windows is friendlier for occasional users. The Settings app reduces the chance of syntax mistakes.
  • Repeatability: Linux is stronger for servers. Text files and terminal commands are easy to copy, audit, and store in change records.
  • Error style: Windows mistakes often come from choosing the wrong adapter. Linux mistakes often come from file formatting, interface names, or competing network services.
  • Remote work risk: Linux servers are often configured over SSH. A bad address can cut off your session. Use console access when possible.
  • Documentation: both systems require clear records. Static addressing without records becomes a guessing game.

Validation Checklist

After setting a static IP, test before walking away. Do not assume the save button means success.

  1. Check the assigned IP: use ipconfig on Windows or ip addr on Linux.
  2. Ping the gateway: this confirms local network reachability.
  3. Ping a public IP: try 1.1.1.1 to test internet routing.
  4. Ping a domain name: try example.com to test DNS.
  5. Reboot once: confirm the static settings survive restart.
  6. Update documentation: record the device name, IP, MAC address, owner, and reason.

Common Mistakes to Avoid

  • Using an address inside the router’s automatic pool, which can cause duplicate IP conflicts.
  • Setting the wrong gateway, which blocks access outside the local subnet.
  • Forgetting DNS, which makes the internet look broken even when routing works.
  • Editing the wrong network adapter, especially on laptops with Ethernet, Wi Fi, VPN, and virtual adapters.
  • Skipping documentation, which creates avoidable support problems months later.

The best approach is practical: use Windows Settings for a single PC, PowerShell for controlled Windows changes, Netplan for Ubuntu servers, and NetworkManager for many Linux desktops and mixed environments. Keep static addresses outside the automatic pool, test gateway and DNS access, and record every assignment. Static IP configuration is not hard, but sloppy planning turns a five minute task into a network outage.

Leave a Reply

Your email address will not be published. Required fields are marked *