Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Networking»How to Set Static IP Address in Windows

How to Set Static IP Address in Windows

Anup ThapaBy Anup ThapaNovember 27, 2022
how to set static ip windows

Windows devices, like most other devices, obtain the IP Address dynamically from the DHCP server. Generally, anyway. If you plan to set up a server of any sort or just access the system remotely, setting a static IP is a good idea.

Do note that we’re talking about static private IP addresses here, i.e., ones assigned to devices on your local network. This is different from a static public IP, i.e. WAN IP assigned to your router/modem. You’ll need to get the details from your ISP and configure the router for the latter. 

Most routers do support DHCP reservation, which uses a device’s MAC Address to assign a static IP to it from within the DHCP scope. But that, again, falls more on the router configuration side of things and will require a tutorial of its own. 

In this article, we’ll instead focus on how you can set a static IPv4 address on Windows devices from the live Windows environment. We’ll do this without accessing the router management interface or anything of the sort.

Table of Contents

  • IPv4 Address Classes
  • Things to Know Before Setting Static IP
  • How to Set Static IP in Windows?
    • Through Control Panel
    • Through Settings
    • Through Command Prompt
    • Through PowerShell

IPv4 Address Classes

An IP address is basically an identifier, a unique set of numbers assigned to a device to identify it on a network. In the case of IPv4, which is still primarily used instead of IPv6, an IP address is a 32-bit number. As such, IPv4 addresses are divided into four octets (e.g., 192.168.10.7).

The first octet, i.e., the first decimal number (192 in the above example), determines the IP class. The table below should help you figure out what class any IP address belongs to and what the default subnet mask for it is.

ip address classes illustration

Let’s look at the earlier example once again. We’re dealing with a class C IP address with a subnet mask of 255.255.255.0. This means the first 24 bits, i.e., the first three octets, represent the network part of the IP address (192.168.10). The remaining bits, or the fourth octet, represents the host part (7).

class c ip address

This is important because when setting a static IP, you should only configure the host ID. Changing the network ID would mean the device is no longer on the same network. In the above example, you would only change 7 to something else.

Class C IP Addresses are most commonly used in small LANs, but let’s also look at a class B case (e.g., 172.16.74.23). Here, the first 16 bits (172.16) represent the network ID, and the remaining bits represent the host ID (74.23). Thus, you can change 74.23 to different values in this scenario.

Things to Know Before Setting Static IP

We’ve covered how the IP Address class affects which values you can change. With this in mind, here are some other things you should know when setting a Static IP on your Windows device:

  • You can use the ipconfig command in CMD to check the device’s current IP address, subnet mask, and default gateway. ipconfig /all will give you much more information, including things like DNS. These will be necessary when setting the static IP.
    ipconfig-all-ethernet-adapter
  • The static IP should be set outside the DHCP scope to ensure IP conflicts don’t happen. You can check the DHCP range via the router’s settings page.
    dhcp-scope-start-end
  • Additionally, you can ping an IP address to ensure it’s not already in use. For instance, if you ping 192.168.18.23 and get “Destination Host is Unreachable” as the output, it usually means the IP isn’t in use.
    ping-destination-host-unreachable
  • In some cases, this output can also occur because the firewall is blocking the connection. Thus, it’s better to use the arp -a command. You can use a static IP as long as it’s not on this list.
    arp-a-arp-table

How to Set Static IP in Windows?

The Network Control Panel applet is very intuitive, and it’s most commonly used to change IP configurations in Windows, so we’ll start with that. Ultimately, the other methods also lead to the same result, so you’re free to use your preferred method.

Through Control Panel

Here are the steps to set a static IP on Windows via the Control Panel:

  1. If you haven’t already, use the ipconfig command. Note the Default Gateway and Subnet Mask of the interface you want to set a static IP for.
    ipconfig-ethernet-adapter
  2. Now, press Win + R, type ncpa.cpl, and press Enter.
  3. Right-click your network connection and select Properties.
    ethernet-connection-properties
  4. Select Internet Protocol Version 4 (TCP/IPv4) and click on Properties.
    ipv4-properties
  5. Select the Use the following IP Address option.
  6. Fill in the Default Gateway and Subnet Mask fields with the values from Step 1.
    set-static-ip-control-panel
  7. In the IP address field, enter the default gateway’s value and change the host ID portion. In the case of Class C addresses, this is the last octet, as we covered earlier.
    set-static-ip-windows-ncpa
  8. If you want to set the DNS server addresses manually, you can do so in the next section.
  9. Finally, press OK to save the changes.

Through Settings

As stated, you can also set a static IP via Windows settings. Here are the necessary steps for this:

  1. Press Win + I and select Network & Internet > Status.
  2. Under the Ethernet or WiFi connection, click on Properties.
    windows-settings-ethernet-properties
  3. Scroll down to the IP settings section and click on Edit.
  4. Select Manual IP Assignment and toggle on IPv4.
    manual-ip-assignment-windows
  5. Set a static IP address to use in the IP address section.
  6. Fill in the Subnet prefix length section. Depending on the IP address class, the values are as follows:
    Class A – 8
    Class B – 16
    Class C – 24
    ip-subnet-prefix-length-windows
  7. Now, fill in the Default Gateway and DNS sections and save the changes.

Through Command Prompt

As usual, the command prompt allows you to assign a static IP efficiently through the netsh tool. Here are the necessary steps to use it:

  1. Press Win + R, type cmd, and press CTRL + Shift + Enter.
  2. Use ipconfig or ipconfig /all and note the interface name and other details like Default Gateway and Subnet Mask.
    ipconfig-all-ethernet-adapter
  3. Fill in the appropriate values and execute the following command:
    Netsh interface ip set address name=”interfacename” static <device IP> <subnet mask> <default gateway>
    netsh-interface-ip-set-address
  4. Optionally, you can use the following commands to set the preferred and alternate DNS server addresses:
    Netsh interface ip set dns name="interfacename" static <dnsserveraddress>
    netsh interface ip add dns name="interfacename" <alternateaddress> index=2

    netsh-interface-ip-set-dns-add-dns

Through PowerShell

Netsh is a legacy tool. If you want a newer alternative, you can also use Powershell’s NetTCPIP module to set a static IP. Here are the necessary steps for this method:

  1. Press Win + R, type powershell, and press CTRL + Shift + Enter.
  2. Enter Get-NetIPConfiguration and note the InterfaceIndex and IPv4 Default Gateway.
    get-net-ip-configuration
  3. Now, replace the appropriate values and use the following command:
    New-NetIPAddress -InterfaceIndex <> -IPAddress <> -PrefixLength <> -DefaultGateway <>
  4. Use the following command to set the DNS server addresses:
    Set-DnsClientServerAddress -InterfaceIndex <> -ServerAddresses <preferreddns>, <alternatedns>
    new-net-ip-address
how-to
Anup Thapa
  • LinkedIn

Anup Thapa is a tech writer at TechNewsToday. He mostly writes informative articles, tutorials, and troubleshooting guides related to Windows systems, networking, and computer hardware. Anup has been writing professionally for almost 5 years, and tinkering with PCs for much longer. His love for all things tech started when he got his first PC over 15 years ago. It was a Pentium IV system running Windows XP on a single 256 MB stick. He spent his formative years glued to this PC, troubleshooting any hardware or software problems he encountered by himself. Professionally, Anup has had brief forays into a variety of fields like coding, hardware installation, writing, etc. In doing so, he's worked with people of different backgrounds and skill levels, from average joes to industry leaders and experts. This has given him not just a versatile skillset, but also a unique perspective for writing that enables him to concisely communicate complex information and solve his reader's problems efficiently. You can contact him at anup@technewstoday.com

Related Posts

packet loss test

How To Perform Packet Loss Test On Windows

January 15, 2023
how to reset ethernet adapter

How To Reset Ethernet Adapter

January 2, 2023
does my pc have wifi

Does Your Desktop Have Wi-Fi? Here’s How to Find Out

January 1, 2023
dns server is not responding

8 Ways to Fix “DNS Server Is Not Responding” Error

December 27, 2022
how-to-reset-spectrum-wifi

How to Reset Spectrum Wi-Fi

December 26, 2022
how to update router firmware tp-link

How to Update Router Firmware on TP-Link (2 Possible Ways)

December 26, 2022
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how long does a cmos battery last

How Long Does a CMOS Battery Last

January 25, 2023
thunderbolt vs usb c

Thunderbolt Vs USB C: What’s the Difference

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
You may also like
how-to-connect-headphones-to-tv

5 Ways to Connect Headphones to TV

January 29, 2023
connect-airpods-to-samsung-tv

How to Connect AirPods to Samsung TV? (Step-by-Step Guide)

January 29, 2023
AIO Pump Not Working

AIO Pump Not Working? Here’s How to Fix It

January 29, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday.

Type above and press Enter to search. Press Esc to cancel.