Manual assignment

How to set a static IP address on Windows 10

You can set a static IP address manually on Windows 10 in a number of ways, and in this guide, you'll learn using Command Prompt, PowerShell, Control Panel, and Settings.

Windows 10 with static IP address configuration

On Windows 10, setting a static IP address to your PC is an essential configuration that may be required in a number of scenarios. For example, if you’re planning to share files or a printer on a local network, or when trying to configure port forwarding.

If you don’t assign a static IP address, the services your computer provides to other devices, or that port forwarding configuration, will eventually stop working. This is because, by default, connected devices use dynamic IP addresses assigned by the DHCP server (usually your router), which can change as soon as you restart your machine or after the dynamically assigned configuration expires.

In this guide, you’ll learn the steps to set a static IP (version 4) address to your Windows 10 device when it’s providing a service on the network, or you’re simply configuring port forwarding to your device on the router. (You can also configure your router to assign a static IP address using the DHCP settings. You can use these steps to set an static IP address to a FreeNAS server.)

How to assign static IP address using Command Prompt

Although using command lines may be challenging for some users, it’s one of the quickest way to assign a static IP address to a Windows 10 PC.

Use these steps to set a static IP address on Windows 10 using Command Prompt:

  1. Open Start.

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

  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
    Windows 10 ipconfig command
  5. Type the following command to assign a static IP address and press Enter:

    netsh interface ip set address name="Ethernet0" static 10.1.2.220 255.255.255.0 10.1.2.1

    In the above command make sure to change Ethernet0 for the name of your network adapter, and you must change 10.1.2.220 255.255.255.0 10.1.2.1 with the device IP address, subnet mask, and default gateway address that correspond to your network configuration.

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

    netsh interface ip set dns name="Ethernet0" static 10.1.2.1

    In the above command make sure to change Ethernet0 with the name of your adapter and 10.1.2.1 with the DNS server address of your network.

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

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

    In the above command make sure to change Ethernet0 with the name of your adapter and 8.8.8.8 with an alternate DNS server address.

    Windows 10 netsh command to set static IP 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 (e.g., ping google.com) to see if the internet is working. Alternatively, you can simply open your web browser and try to navigate to a website to see if the configuration works.

Microsoft is in the process of retiring netsh from Windows 10, as such you should start using the NetTCPIP networking module available in PowerShell instead.

How to assign static IP address using Control Panel

If the Windows Console isn’t for you, it’s still possible to use Control Panel to change the IP settings of your Windows 10 computer.

Use these steps to assign a static IP configuration using Control Panel:

  1. Open Control Panel.

  2. Click on Network and Internet.

  3. Click on Network and Sharing Center.

  4. On the left pane, click the Change adapter settings link.

    Control Panel's Network and Sharing Center
    Control Panel Network and Sharing Center
  5. Right-click the network adapter and select Properties.

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

  7. Click the Properties button.

    Control Panel's network adapter properties
    Control Panel’s network adapter properties
  8. Select the Use the following IP address option.

  9. Set the IP address (e.g., 10.1.2.220).

  10. Set the Subnet mask. Usually, on a home network, the subnet mask is 255.255.255.0.

  11. Set the Default gateway. This address is typically your router’s IP address (e.g., 10.1.2.1).

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

  13. (Optional) Enter set the Alternative DNS server, which your computer will use if it can’t reach the preferred server.

  14. Click the OK button.

    Windows 10 network adapter TCP/IPv4 properties
    Windows 10 network adapter TCP/IPv4 properties
  15. Click the Close button again to close the network adapter properties.

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

How to assign static IP address using PowerShell

Windows 10 also includes the PowerShell (version 5) 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 device.

Use these steps to set a static IP address with PowerShell:

  1. Open Start.

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

  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
    PowerShell’s Get-NetIPConfiguration command
  4. Type the following command to set a static IP address and press Enter:

    New-NetIPAddress -InterfaceIndex 4 -IPAddress 10.1.2.220 -PrefixLength 24 -DefaultGateway 10.1.2.1
    PowerShell's New-NetIPAddress command
    PowerShell’s New-NetIPAddress command

    In the above command make sure to change the InterfaceIndex number with the one corresponding to your adapter. Change IPAddress with the IP address you want to assign to your device. Only if necessary, change PrefixLength (subnet mask) with the correct bit number. Typically on a home network the setting is 24.

    Also, change DefaultGateway with the default gateway address of your network.

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

    Set-DnsClientServerAddress -InterfaceIndex 4 -ServerAddresses 10.1.2.1
    PowerShell's Set-DNSClientServerAddress command
    PowerShell’s Set-DNSClientServerAddress command

    If you need to set a secondary DNS server address, you can use the same command, and to add another address simply use a comma.

    Set-DnsClientServerAddress -InterfaceIndex 4 -ServerAddresses 10.1.2.1, 8.8.8.8

    In the above command make sure to change the InterfaceIndex number with the one corresponding to your adapter, and change ServerAddresses with the DNS IP address.

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

How to assign static IP address using Settings

On Windows 10, you can also change the IP address settings using the Settings app for wireless as well as wired adapters.

Assigning static IP address for Wi-Fi adapter

Use these steps to assign a static IP address configuration to a Wi-Fi adapter:

  1. Open Settings.

  2. Click on Network & Internet.

  3. Click on Wi-Fi.

  4. Click on the current connection.

    Wi-Fi settings
    Wi-Fi settings
  5. Under “IP settings,” click the Edit button.

    Wi-Fi IP settings on Windows 10
    Wi-Fi IP settings on Windows 10
  6. Using the drop-down menu, select the Manual option.

    Wi-Fi static IP option
    Wi-Fi static IP option
  7. Turn on the IPv4 toggle switch.

    Wi-Fi edit IP address settings
    Wi-Fi edit IP address settings
  8. Set the static IP address.

  9. Set the Subnet prefix length (subnet mask). If your subnet mask is 255.255.255.0, then the subnet prefix length in bits is 24.

  10. Set the Default Gateway address.

  11. Set the Preferred DNS address.

  12. Set the Alternate DNS address (if applicable).

  13. Click the Save button.

    Wi-Fi TCP/IPv4 static configuration
    Wi-Fi TCP/IPv4 static configuration

Once you’ve completed the steps, you can test your settings using your web browser to try opening a website.

Assigning static IP address for Ethernet adapter

Use these steps to assign a static IP address configuration to an Ethernet (wired) adapter:

Important: The ability to change networking protocol settings on an Ethernet adapter is available starting Windows 10 version 1903, May 2019 Update, and later releases.
  1. Open Settings.

  2. Click on Network & Internet.

  3. Click on Ethernet.

  4. Click on the current connection.

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

    Ethernet IP settings on Windows 10
    Ethernet IP settings on Windows 10
  6. Using the drop-down menu, select the Manual option.

    Ethernet static IP option
    Ethernet static IP option
  7. Turn on the IPv4 toggle switch.

    Ethernet edit IP address settings
    Ethernet edit IP address settings
  8. Set the static IP address.

  9. Set the Subnet prefix length (subnet mask). If your subnet mask is 255.255.255.0, then the subnet prefix length in bits is 24.

  10. Set the Default Gateway address.

  11. Set the Preferred DNS address.

  12. Set the Alternate DNS address (if applicable).

  13. Click the Save button.

    Ethernet TCP/IPv4 static configuration
    Ethernet TCP/IPv4 static configuration

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

Whatever the method you use, it’s recommended to assign an IP address within the network range and outside of the DHCP server scope to allow proper connectivity and avoid address conflicts, as if two devices share the same IP address neither of them will be able to connect to the internet.

If you need help configuring a static IP address on Windows 10, make sure to ask in the Pureinfotech forums.

Although we’re focusing this guide on Windows 10, you can use the Command Prompt and Control Panel methods on Windows 8.1 and Windows 7.

Update August 5, 2019: This guide was originally published in September 2017, and it’s been updated to reflect the new changes available on Windows 10.