4 ways to change the Subnet Mask in Windows 10

Subnet masks are used to split IP addresses into two different parts: one of them tells you the computer or device's address, while the other tells you the network which it belongs to. In other words, subnet masks are used to divide networks into subnetworks, so that any data transmitted over a network can reach its destination correctly. Are you wondering how to change the subnet mask on your Windows 10 PCs? Do you want to learn how to change the subnet mask for all the computers and devices in your local home network? Read on and find out:

Read this first before changing the Subnet Mask in Windows 10

Before changing your Windows 10 PC's subnet mask, you should be familiar with what IP addresses and subnet masks are, and how to find what your Windows 10 computer IP address is.

On your Windows 10 computer or device, you can change the subnet mask only if you're using a static IP address. If that's the case for you, or if you want also to change your IP address and set a static one, read the instructions from the first three methods in this guide.

If you're using a dynamic IP address that's automatically generated by the DHCP service on your router, you can only change the subnet mask from your router's web interface. Read the last section of this guide for instructions on how to do that on a home router.

You should also note that to be able to change your subnet mask (and/or IP address) in Windows 10, you must log in using an administrator account.

1. How to change the Subnet Mask in Windows 10, from the Settings app

One of the easiest ways to change the subnet mask in Windows 10 is offered by the Settings app. Launch it and go to the Network & Internet category.

The Network & Internet settings in Windows 10

In Network & Internet, select Wi-Fi or Ethernet on the left sidebar, depending on the type of the network adapter for which you want to change the subnet mask. Then, on the right side of the window, click or tap on the corresponding network connection.

Opening the settings page of a network connection

On the network connection page, scroll down until you reach the IP settings section. Then, push the Edit button.

Editing the IP settings of a network connection

This opens a dialog called "Edit IP settings" where you can change the IP address, subnet mask, gateway, and the DNS servers used by the selected network connection, both for the Internet Protocol Version 4 (TCP/IPv4) and the Internet Protocol Version 6 (TCP/IPv6). Scroll to the IPv4 or IPv6 section, depending on which of them you want to configure a new subnet mask.

The setting that determines the subnet mask is the Subnet prefix length, which controls the size of the subnet. For example, in the screenshot below, you can see that, for our network connection IPv4 protocol, we're using a "Subnet prefix length" of 24 (the number of 1 bits in the netmask), which means that the subnet mask is

The Subnet prefix length setting of a network connection

To change your subnet mask, you must change the value of the "Subnet prefix length" field. For example, because we wanted to have a subnet mask of, we had to set the prefix length to 20. If you need help on calculating the prefix length for a subnet mask, check this online IP Subnet Calculator.

Saving the new subnet mask

Click or tap Save, and your subnet mask is immediately changed.

2. How to change the Subnet Mask in Windows 10, from the Control Panel

Windows 10 still includes the old Control Panel, which also lets you change your network adapter's subnet mask. If you prefer using the Control Panel for this task, open it and click or tap on the "View network status and task" link from under Network and Internet.

View network status and tasks in Control Panel

In the Network and Sharing Center, click or tap on the network connection for which you want to change the subnet mask.

Opening the details of a network connection

The previous action opens the Status window of that network connection. In it, push the Properties button.

The Status window of a network connection

In the network connection's Properties window, select the select Internet Protocol Version 4 (TCP/IPv4) or Internet Protocol Version 6 (TCP/IPv6), depending on the subnet mask that you want to change. If you want to change both, repeat the next steps for each of them.

Opening the Properties window for IPv4

If you want to change the subnet mask used for the Internet Protocol Version 4 (TCP/IPv4), in its Properties window, enter the new subnet mask in the field bearing the same name.

For example, we wanted to change our subnet mask to, as you can see in the next screenshot.

Changing the subnet mask of a network connection

Once you're done making all the changes, click or tap on OK and then close all the open windows. The new subnet mask that you've set is now up and running.

3. How to change the Subnet Mask in Windows 10, using PowerShell

If you prefer using a command-line environment, you can also change your subnet mask in Windows 10 using PowerShell. Open PowerShell as an admin and run the following command: Get-NetAdapter -physical. This command shows you all the network adapters installed on your Windows 10 computer. Identify the one for which you want to change the subnet mask and note its ifIndex value. That's the interface index number that you can use to select the network adapter in the next PowerShell command.

Get-NetAdapter -physical

To change the subnet mask, now run this command: Set-NetIPAddress -InterfaceIndex [ifIndex value] -PrefixLength [subnet prefix length]. Replace [ifIndex value] with the interface index value that you've identified on the previous command, and replace [subnet prefix length] with the value of the new subnet prefix length that you want.

For example, we wanted to set a subnet mask of, so we ran this command: Set-NetIPAddress -InterfaceIndex 7 -PrefixLength 24.

Set-NetIPAddress -InterfaceIndex [ifIndex value] -PrefixLength [subnet prefix length]

The new subnet mask is instantly applied, so you can now close PowerShell.

4. How to change the Subnet Mask from the router's interface, on a home network with DHCP

If you're using DHCP to automatically assign IP addresses to the computers and devices in your home, you can change the subnet mask for all of them from your router's administration interface. Use a web browser on your PC to access the router's web interface. To do that, you must go to the router's address and sign in with your user account and password. On most routers out there, that's or, but it can differ. If you don't know the IP address of your router, check this guide: 5 ways to find the local IP address of your wireless router.

Opening the web interface of a router

On the router's web admin interface, look for an advanced settings category called LAN. In it, go to the LAN IP settings section or tab, and change the value of the Subnet Mask with the one you want. Click or tap on Apply, Save, or OK. Once you do that, the new subnet mask is applied to all the computers and devices from your network that use automatic IP addresses. Note that your router might need to reboot to apply this change.

Changing the subnet mask on a router

That was it!

Why did you want to change the subnet mask on your Windows 10 PC?

Now you know how to change the subnet mask on your Windows 10 PC or even on your entire home network. We're curious: why did you need that information? Was it for work or for your home? Also, if you have anything to add to this guide, do not hesitate to comment in the dedicated section below.

Discover: Smarthome Network and Internet Tutorials Windows Wireless
Join the discussion: See the comments Comment