How to Set a Static IP Address (Windows, Mac & Router)
Step-by-step instructions to assign a static (fixed) IP address on Windows, macOS, Linux and via your router's DHCP reservation β and when you'd actually want to.
Setting a static IP address means giving a device a fixed local address that never changes, instead of letting it receive a fresh one each time it joins the network. It is the reliable way to make sure your home server, printer, NAS or smart-home hub always sits at the same address, so port forwarding rules, bookmarks and scripts keep working. This guide shows you how to do it correctly on every platform, plus the cleaner router-based method most people should use first.
Static IP vs DHCP reservation: which should you use?
By default, devices get their address automatically from your router using DHCP. A static IP overrides that. There are two ways to achieve a fixed address, and they are not equal:
- A DHCP reservation (recommended): you tell the router to always hand a specific device the same address, based on its MAC address. The device still uses automatic configuration, so it always receives the correct gateway and subnet β you just guarantee the address.
- A manual static IP on the device: you type the address, subnet mask, gateway and DNS directly into the device. This works anywhere, even without router access, but a single typo breaks connectivity, and the router does not know the address is taken.
If you can log in to your router, the reservation method is almost always cleaner and safer. We will cover both. First, though, you need to choose a safe address.
Before you set anything, find your current network details. On Windows run ipconfig; on macOS/Linux run ip route and ip a. Note your subnet (e.g. 192.168.1.x), your default gateway (your router, often 192.168.1.1), and your router's DHCP range. Pick a static address inside the subnet but outside the DHCP range so it can never collide with an automatically assigned one.
Set a static IP on Windows (10 and 11)
You can use the Settings app or the classic Control Panel. The Settings route:
- Open Settings β Network & Internet.
- Click Wi-Fi (then your network's properties) or Ethernet.
- Find IP assignment and click Edit.
- Change the drop-down from Automatic (DHCP) to Manual, and switch on IPv4.
- Enter your chosen IP address (e.g.
192.168.1.50), Subnet mask (usually255.255.255.0, or a prefix length of24), Gateway (192.168.1.1), and Preferred DNS (1.1.1.1, with alternate1.0.0.1). - Click Save.
Prefer the command line? Open an elevated PowerShell and use netsh:
netsh interface ip set address name="Wi-Fi" static 192.168.1.50 255.255.255.0 192.168.1.1
netsh interface ip set dns name="Wi-Fi" static 1.1.1.1
netsh interface ip add dns name="Wi-Fi" 1.0.0.1 index=2
To revert to automatic later: netsh interface ip set address name="Wi-Fi" dhcp.
Set a static IP on macOS
- Open System Settings β Network.
- Select your active service (Wi-Fi or Ethernet) and click Detailsβ¦.
- Go to the TCP/IP tab.
- Set Configure IPv4 to Manually.
- Enter the IP Address (
192.168.1.50), Subnet Mask (255.255.255.0) and Router (192.168.1.1). - Switch to the DNS tab and add
1.1.1.1and1.0.0.1. - Click OK.
A middle-ground option here is Using DHCP with manual address, which keeps automatic gateway and DNS settings while pinning just the address β handy if you only want a stable IP without hand-typing everything else.
Set a static IP on Linux
Most modern desktops use NetworkManager. The quickest graphical route is to open your network settings, edit the connection, choose the IPv4 tab, set the method to Manual, and add your address, netmask, gateway and DNS. From the terminal, nmcli does the same:
nmcli con mod "MyConnection" ipv4.addresses 192.168.1.50/24
nmcli con mod "MyConnection" ipv4.gateway 192.168.1.1
nmcli con mod "MyConnection" ipv4.dns "1.1.1.1 1.0.0.1"
nmcli con mod "MyConnection" ipv4.method manual
nmcli con up "MyConnection"
Replace "MyConnection" with the name shown by nmcli con show. Servers using systemd-networkd or Netplan (Ubuntu Server) configure the same values in a YAML or .network file instead.
Set a static IP with a router DHCP reservation (recommended)
This is the approach we suggest for most people, because the router stays in charge and the device needs no manual setup. Steps vary by brand, but the pattern is consistent:
- Open a browser and go to your router's admin page at its gateway address, commonly
192.168.1.1or192.168.0.1. If you are unsure, our guide to finding your IP address shows how to read the default gateway. - Log in (credentials are often on a sticker on the router).
- Find a section named DHCP, LAN, Address Reservation or Static Leases β frequently under Advanced settings.
- Locate your device in the list of connected clients, or add a new entry. You will match its MAC address to a chosen IP such as
192.168.1.50. - Save, then reconnect the device (or reboot it) so it picks up the reserved address.
Set a static IP on iPhone and Android
You can also fix the address per Wi-Fi network on mobile, though a router reservation is tidier:
- iPhone/iPad: Settings β Wi-Fi, tap the (i) next to your network, tap Configure IP, choose Manual, and enter the address, subnet mask and router.
- Android: Settings β Network & internet β Wi-Fi, long-press or tap the gear on your network, choose Modify/Advanced β IP settings, switch from DHCP to Static, and fill in the fields.
Quick comparison: reservation vs manual static IP
| Router DHCP reservation | Manual static on device | |
|---|---|---|
| Where it's set | Router admin page | The device itself |
| Risk of conflicts | Low β router tracks it | Higher β router unaware |
| Survives OS reinstall | Yes (tied to MAC) | No β must redo |
| Needs router access | Yes | No |
| Best for | Most home setups | Devices you can't reserve |
When you actually need a static IP
You do not need one for ordinary browsing β that is exactly what dynamic addressing handles gracefully. A fixed local address earns its keep when a device needs to be reliably reachable at a known location: a printer you connect to by address, a NAS or home server, security cameras, a machine you forward ports to, or anything referenced by IP in another config. If you are weighing this up more broadly, our explainer on static vs dynamic IP addresses covers the trade-offs, and note that a static local IP is entirely separate from a static public IP from your ISP.
Remember to keep your static addresses out of the DHCP pool and out of the way of reserved addresses like the network and broadcast addresses. Get those right and the device will sit at its address indefinitely. If you ever want to confirm what the wider internet sees, IP Animals will show you your public address in a couple of seconds.
Frequently asked questions
Should I set a static IP on the device or use a DHCP reservation?
A DHCP reservation on your router is usually the better choice. It keeps a device pinned to the same address while letting the router remain the single source of truth for your network's settings, which avoids the address conflicts and misconfiguration that manual device-side static IPs often cause.
Does a static local IP change my public IP address?
No. Setting a static IP on a device only fixes its private address inside your own network. Your public IP, the one the internet sees, is assigned by your ISP and is unaffected by anything you configure on a single device.
What IP address should I choose for a static assignment?
Pick an address in your router's subnet but outside its DHCP range, so it can never be handed to another device automatically. For example, if the router gives out 192.168.1.100 to 192.168.1.200, a safe static choice would be something like 192.168.1.50.
Why did my device lose internet after setting a static IP?
Almost always because the gateway, subnet mask or DNS server was entered incorrectly, or the chosen address clashes with another device. Double-check that the gateway matches your router's address and that DNS is set to a working resolver such as 1.1.1.1.
Can I set a static IP on my phone?
Yes. Both iPhone and Android let you switch a saved Wi-Fi network from automatic to manual or static addressing in its settings, but a router DHCP reservation is generally cleaner because it survives forgetting and rejoining the network.