By default, most devices on your network receive their IP address automatically through DHCP (Dynamic Host Configuration Protocol). Your router assigns an address from its available pool, and that address can change over time โ€” typically when the DHCP lease expires or the device reconnects. For most everyday use, this is perfectly fine. But certain situations demand a fixed, unchanging address on your local network: hosting a server, configuring port forwarding, setting up a network printer, running a security camera system, or simply wanting reliable remote access to a specific machine.

Over 20 years of setting up and managing networks, I've configured static IP addresses on thousands of devices across every major operating system. In this guide, I'll walk you through the process on Windows, Mac, and Linux, explain when you actually need a static IP versus when DHCP is fine, and show you how to avoid the most common mistakes that cause network conflicts.

When You Actually Need a Static IP

Before diving into configuration, let's clarify when a static IP is necessary and when it's not. You need a static private IP address on your local network when you're setting up port forwarding on your router (because the forwarding rule points to a specific IP, and if that IP changes, the rule breaks), when you're running any kind of server that other devices need to find reliably (web server, file server, game server, media server), when you're configuring a network printer that multiple devices need to print to, or when you're deploying security cameras or IoT devices that need consistent addressing for management and monitoring.

You probably don't need a static IP for general-purpose devices like your daily-use laptop, phone, or tablet. These devices don't host services that other devices need to reach by IP address, so a dynamic address works perfectly. In fact, using DHCP for these devices is preferable because it reduces the chance of address conflicts and simplifies network management.

It's also important to distinguish between a static private IP (which you configure yourself on your local network) and a static public IP (which you get from your ISP, usually for an additional monthly fee). This guide covers static private IP configuration. If you need a static public IP, you'll need to contact your ISP to purchase one. You can check your current public IP at IP Lobster to see what your ISP has assigned you.

Choosing the Right Static IP Address

Before you set a static IP on any device, you need to choose an address that won't conflict with other devices on your network. The most common mistake I see is picking an address that falls within your router's DHCP range, which means the router might try to assign that same address to another device.

First, check your router's DHCP configuration. Log into your router's admin interface (typically at 192.168.1.1 or 192.168.0.1) and find the DHCP settings. Note the DHCP range โ€” for example, it might assign addresses from 192.168.1.100 to 192.168.1.254. To avoid conflicts, choose a static IP outside this range but within the same subnet. In this example, addresses from 192.168.1.2 to 192.168.1.99 would be safe for static assignments (192.168.1.1 is typically the router itself).

You'll also need to know three pieces of information from your current network configuration: the subnet mask (almost always 255.255.255.0 for home networks), the default gateway (your router's IP address), and the DNS servers (either your router's address or external servers like 1.1.1.1 or 8.8.8.8). You can find all of these from any currently connected device on the network.

Setting a Static IP on Windows

On Windows 10 and Windows 11, there are two methods: through the Settings app or through the classic Control Panel. The Settings app method is more modern but the Control Panel method gives you more control.

Using Settings: Open Settings and navigate to Network & Internet. Click on your active connection (Wi-Fi or Ethernet). Click on "IP assignment" and then "Edit." Change the setting from "Automatic (DHCP)" to "Manual." Toggle on IPv4 and enter your chosen static IP address, subnet mask (as a prefix length โ€” 255.255.255.0 is equivalent to prefix length 24), gateway, and preferred DNS server. Click Save.

Using Control Panel: Open Control Panel, go to Network and Sharing Center, click "Change adapter settings" in the left panel. Right-click your active network adapter and select Properties. Select "Internet Protocol Version 4 (TCP/IPv4)" and click Properties. Select "Use the following IP address" and enter your static IP, subnet mask (255.255.255.0), and default gateway. Below that, select "Use the following DNS server addresses" and enter your preferred DNS servers. Click OK on both dialogs.

Using Command Line: For those who prefer the command line, open an elevated Command Prompt and use the netsh command: netsh interface ip set address "Ethernet" static 192.168.1.50 255.255.255.0 192.168.1.1 followed by netsh interface ip set dns "Ethernet" static 1.1.1.1. Replace "Ethernet" with your adapter name and adjust the addresses to match your network.

After setting the static IP, verify it's working by opening a command prompt and running ipconfig. Confirm the IP address, subnet mask, and gateway match what you configured. Then test connectivity by pinging your router (ping 192.168.1.1) and an external address (ping 8.8.8.8).

Setting a Static IP on Mac

On macOS, open System Settings (or System Preferences on older versions) and navigate to Network. Select your active connection (Wi-Fi or Ethernet) from the list. Click on Details (or Advanced on older versions).

Go to the TCP/IP tab. Change "Configure IPv4" from "Using DHCP" to "Manually." Enter your chosen static IP address, the subnet mask (255.255.255.0), and the router address (your gateway). Then go to the DNS tab and add your preferred DNS servers. Click OK and then Apply.

Using Terminal: You can also configure a static IP from the command line on Mac using: sudo networksetup -setmanual "Wi-Fi" 192.168.1.50 255.255.255.0 192.168.1.1 followed by sudo networksetup -setdnsservers "Wi-Fi" 1.1.1.1 8.8.8.8. Replace "Wi-Fi" with your connection name and adjust addresses accordingly.

Verify the configuration by opening Terminal and running ifconfig to check your IP address, then ping your router and an external address to confirm connectivity.

Setting a Static IP on Linux

Linux offers several methods depending on your distribution and network management system. The three most common approaches are NetworkManager (used by Ubuntu, Fedora, and most desktop distributions), netplan (used by recent Ubuntu Server versions), and direct configuration through systemd-networkd.

Using NetworkManager (GUI): Open your network settings, select your active connection, and click the gear icon to edit it. Go to the IPv4 tab, change the method from "Automatic (DHCP)" to "Manual," and add your static IP address, netmask, and gateway. Add DNS servers in the DNS field. Apply the changes and reconnect.

Using NetworkManager (CLI): Use the nmcli command: sudo nmcli con mod "Wired connection 1" ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.dns "1.1.1.1,8.8.8.8" ipv4.method manual followed by sudo nmcli con up "Wired connection 1".

Using Netplan (Ubuntu Server): Edit the netplan configuration file at /etc/netplan/01-netcfg.yaml (the filename may vary). Set the configuration with your interface name, static address using CIDR notation (like 192.168.1.50/24), gateway, and nameservers. Then apply with sudo netplan apply.

Verify with ip addr show to check your address, ip route to verify the gateway, and ping to test connectivity.

The Better Alternative: DHCP Reservations

There's actually a third approach that I recommend over manually configuring static IPs on individual devices: DHCP reservations (also called static DHCP leases). Instead of configuring the IP address on the device itself, you configure your router to always assign the same IP address to a specific device based on its MAC address.

The advantage of DHCP reservations is that the device still uses DHCP to get its configuration โ€” including gateway, DNS servers, and other settings โ€” so if you ever change your network configuration, you only need to update the router rather than reconfiguring every device. The device always gets the same IP, achieving the same practical result as a static IP, but with centralized management.

To set up a DHCP reservation, log into your router's admin interface and look for a section labeled "DHCP Reservations," "Address Reservation," or "Static Leases." You'll need the device's MAC address (a unique hardware identifier for each network adapter) and the IP address you want to assign. The device's MAC address can be found in its network settings or by checking your router's list of connected devices.

In enterprise environments, DHCP reservations are almost always preferred over static IP configuration on individual machines. In home environments, either approach works, but reservations are easier to manage long-term, especially as you add more devices.

Troubleshooting Common Issues

IP address conflict: If you set a static IP that's already in use by another device, both devices will have connectivity issues. You'll typically see a warning about an IP conflict. Verify the address isn't already in use by pinging it before assigning it, and keep a simple spreadsheet or document tracking your static IP assignments.

No internet access after setting static IP: This almost always means the gateway or DNS servers are configured incorrectly. Double-check that the gateway address matches your router's IP and that your DNS servers are valid. A quick test: try pinging the gateway by IP (e.g., ping 192.168.1.1). If that works but websites don't load, the problem is DNS. If the ping fails, the gateway address is wrong or there's a subnet mismatch.

Wrong subnet mask: If the subnet mask doesn't match your network's configuration, the device won't be able to communicate properly. For virtually all home and small office networks, the subnet mask should be 255.255.255.0 (or /24 in CIDR notation). Getting this wrong will cause intermittent or complete connectivity failures.

Reverting to DHCP: If things go wrong and you need to undo the static IP configuration, simply reverse the process: on Windows, set the IP configuration back to "Obtain an IP address automatically"; on Mac, change "Configure IPv4" back to "Using DHCP"; on Linux, change the method back to "auto" or "dhcp." The device will request a new address from your router's DHCP server and return to normal operation within seconds.