How to set static IP address on Windows 10

You can assign a static IP address manually on Windows 10 in many ways, and in this guide, you'll learn how.

Windows 10 with static IP address configuration
  • To set a static IP address on Windows 10, open Settings > Network & Internet > Wi-Fi.
  • Then click the connection, click on “Edit,” select “Manual,” turn on “IPv4,” and set the static IP address.
  • Alternatively, you can configure a static IP address from Command Prompt, PowerShell, and Control Panel.

On Windows 10, setting a static IP address to a computer is a configuration you may need to set up in many scenarios. For instance, if you plan to share files, a printer on a local network, or configure port forwarding.

If you don’t assign a static IP address, services or a port forwarding configuration may eventually stop working. The reason is that, by default, connected devices use dynamic IP addresses assigned by the Dynamic Host Configuration Protocol (DHCP) server (usually the router), which can change anytime, as soon as you restart the machine or after the dynamically assigned configuration lease expires.

This guide will teach you the steps to set a static IP (version 4) address to a Windows 10 device when providing a service on the network or simply configuring port forwarding to your device on the router.

Set static IP address on Windows 10

To assign a static IP address on Windows 10, use these steps:

  1. Open Settings on Windows 10.

  2. Click on Network & Internet.

  3. Click on “Wi-Fi” or “Ethernet.”

  4. Click on the current network connection.

    Wi-Fi settings

  5. Under the “IP settings” section, click the Edit button.

    Wi-Fi IP settings on Windows 10

  6. Using the drop-down menu, select the Manual option.

  7. Turn on the “IPv4” toggle switch.

    Wi-Fi edit IP address settings

  8. Set a static IP address to use by the Windows 10 computer.

  9. Specify a “Subnet prefix length” (subnet mask). If the subnet mask is 255.255.255.0, the subnet prefix length in bits is 24.

  10. Specify a “Default Gateway” address.

  11. Specify a “Preferred DNS” address.

  12. Specify an “Alternate DNS address” (if applicable).

  13. Click the Save button.

    Wi-Fi TCP/IPv4 static configuration

After you complete the steps, you can test your settings using your web browser to open a website.

Set static IP address on Windows 10 from Control Panel

To assign a static IP from Control Panel on Windows 10, use these steps:

  1. Open Control Panel.

  2. Click on Network and Internet.

  3. Click on Network and Sharing Center.

  4. Click the Change adapter settings option on the left navigation pane.

    Control Panel's Network and Sharing Center

  5. Right-click the network adapter and select the Properties option.

  6. Select the “Internet Protocol Version 4 (TCP/IPv4)” option.

  7. Click the Properties button.

    Control Panel's network adapter properties

  8. Select the Use the following IP address option.

  9. Assign the static IP address – for example, 10.1.2.220.

  10. Specify a Subnet mask. Typically, on a home network, the subnet mask is 255.255.255.0.

  11. Specify a Default gateway. (Usually, your router’s IP address. For example, 10.1.2.1.)

  12. Under the “Use the following DNS server addresses set Preferred DNS server” section, set the Preferred DNS server address, usually your router’s IP address or server IP address providing DNS resolutions (for example, 10.1.2.1).

  13. (Optional) Specify an Alternative DNS server, which the computer will use if it cannot reach the preferred DNS server.

  14. Click the OK button.

    Windows 10 network adapter TCP/IPv4 properties

  15. Click the Close button again.

Once you complete the steps, you can open your web browser and load a website to see if the configuration works.

Set static IP address on Windows 10 from Command Prompt

To set a static IP address on Windows 10 from Command Prompt, use these steps:

  1. Open Start on Windows 10.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to see your current networking configuration and press Enter:

    ipconfig /all
  4. Under the network adapter, note the name of the adapter as well as the following information in these fields:

    • IPv4
    • Subnet mask
    • Default Gateway
    • DNS Servers

    Windows 10 ipconfig command

  5. Type the following command to assign a static IP address on Windows 10 and press Enter:

    netsh interface ip set address name="Ethernet1" static 10.1.4.220 255.255.255.0 10.1.4.1

    In the above command, replace Ethernet0 with the name of your network adapter. Change 10.1.4.220 255.255.255.0 10.1.4.1 with the device IP address, subnet mask, and default gateway address corresponding to your network configuration.

  6. Type the following command to set a DNS server address and press Enter:

    netsh interface ip set dns name="Ethernet1" static 10.1.4.1

    In the command, make sure to change Ethernet0 with your adapter’s name and 10.1.4.1 with the DNS server address of the network.

  7. Type the following command to set an alternate DNS server address and press Enter:

    netsh interface ip add dns name="Ethernet1" 8.8.8.8 index=2

    In the command, replace Ethernet0 with your adapter’s name and 8.8.8.8 with an alternate DNS server address.

    Windows 10 netsh command to set static IP address

After you complete the steps, you can test the new configuration using the ping command (for example ping google.com) to see if the internet is working. Alternatively, you can open a website to see if the configuration works.

Microsoft is in the process of retiring netsh from Windows 10. As a result, you should start using the “NetTCPIP” networking module available in PowerShell instead.

Set static IP address on Windows 10 from PowerShell

Windows 10 also includes the PowerShell command line platform that allows you to use the “NetTCPIP” module to manage networking settings, including the ability to change the IP address settings of your computer.

To set a static IP address with PowerShell, use these steps:

  1. Open Start.

  2. Search for PowerShell, right-click the result, and select the Run as administrator option.

  3. Type the following command to view your current network configuration and press Enter:

    Get-NetIPConfiguration

    After running the command, note the following information: 

    • InterfaceIndex
    • IPv4Address
    • IPv4DefaultGateway
    • DNSServer

    PowerShell's Get-NetIPConfiguration command

  4. Type the following command to set a static IP address and press Enter:

    New-NetIPAddress -InterfaceIndex 5 -IPAddress 10.1.4.220 -PrefixLength 24 -DefaultGateway 10.1.4.1

    PowerShell's New-NetIPAddress command

    In the command, replace the InterfaceIndex number (5) with the corresponding number of your adapter. Change IPAddress with the static IP address you want to assign to your device. Change PrefixLength (subnet mask) with the correct bit number if necessary. Typically on a home network, the setting is 24. Also, change the DefaultGateway option with the default gateway address of the network.

  5. Type the following command to assign a DNS server address and press Enter:

    Set-DnsClientServerAddress -InterfaceIndex 5 -ServerAddresses 10.1.4.1

    PowerShell's Set-DNSClientServerAddress command

    If you need to set a secondary DNS server address, use a comma to use the same command with another address. For example:

    Set-DnsClientServerAddress -InterfaceIndex 5 -ServerAddresses 10.1.4.1, 8.8.8.8

    In the command, replace the InterfaceIndex number (5) with your network adapter’s corresponding number. Also, change ServerAddresses with the DNS IP address.

After you complete the steps, you can test the new configuration by opening your web browser and navigating a website.

Whatever method you use, assigning an IP address within the network range and outside of the DHCP server scope is recommended to allow proper connectivity and avoid address conflicts. If multiple devices share the same address, this will cause a networking conflict, preventing connection to the internet.