PDF download Download Article PDF download Download Article

Do you need to find or change the subnet mask for your computer, phone, or tablet? If you're using a device that has a static (permanent) IP address that must be configured manually, making sure the subnet mask is correct is crucial when troubleshooting network issues. This wikiHow article will teach you how to find and change the subnet mask on a computer running Windows, macOS, or Linux, as well as on your Android, iPhone, or iPad. We'll also show you how to calculate a subnet mask based on an IP address range if you're not sure which subnet mask to use.

Things You Should Know

  • Most people don't have to enter a subnet mask manually—the router you're connected to assigns it automatically using DHCP.
  • If your device has a static IP address that is not assigned automatically, you can manually update your subnet mask on your computer, phone, or tablet if needed.
  • If you don't know which subnet mask to use, you can figure it out based on the range of IP addresses from which your IP address was assigned.
Section 1 of 6:

How do I find the subnet mask for an IP address?

PDF download Download Article
  1. Unfortunately, you can't determine the correct subnet just by looking at an IP address. Each IPv4 subnet has a subnet mask, also known as a netmask, which is basically an alias for the range of IP addresses allocated to that network. If you use a subnet mask that isn't correct for your IP range, your device won't be able to access the internet. [1]
    • If your IP address is assigned automatically , so is your subnet mask. In this case, if you're connected to the internet, don't worry about finding or changing your subnet mask.
    • But, if you're setting up a static IP address that isn't assigned automatically, you'll need to find the right subnet mask to get online.
    • The easiest way to find out what subnet mask you should be using is to ask your network administrator. If that's not possible right now, read on!
  2. You can use the instructions in this article to find the IP address and subnet mask for other Windows , Linux , macOS , Android , and iOS devices on the network and simply use the same subnet mask.
    • This is not foolproof, as network administrators can divide up IP ranges into many subnets. But for smaller networks, this might be all you need to do to find the subnet mask.
    • Once signed in, compare the other device's IP address to your static IP. Do they appear to be in the same range or from a similar-sized range? If so, using that device's subnet mask might work.
      • For example, if your static IP address is 192.168.0.5 and the other device is 192.168.0.12, having the first three octets in common means you're likely on the same subnet. However, subnets can be broken up in a multitude of ways so there's a chance your network administrator has sub-divided the network even further.
    Advertisement
  3. Once you know the range of IP addresses (or you think you can guess it), use a subnet calculator or cheat sheet to find the subnet mask. There's no need to do complicated math to calculate the subnet mask once you have the range thanks to these handy tools:
    • Spiceworks' Subnet Calculator is easy to use if you know the IP range. Just enter the first and last IP addresses in the range, then choose 1 as the number of subnets (if you're sure the range you've entered is a single subnet).
    • Subnet Calculator and Cheat Sheet provides a subnet mask based on a starting IP address and its associated CIDR notation, which is a special value that explains how many addresses are in that range. If you're not sure what to enter here, just refer to the CIDR cheat sheet at the bottom of the tool.
      • For example, if you're working with a range of 256 IP addresses (a common subnet size for homes and small offices), you'll use /24 . For /24 ranges, the subnet mask will be 255.255.255.0.
      • The cheat sheet at the bottom is also helpful if you just want to try to guess the subnet mask based on the presumed size of the subnet. For example, you'll see that when a subnet contains 1024 IP addresses, its mask will be 255.255.252.0, which is /22 in CIDR notation.
  4. Advertisement
Section 2 of 6:

Find the Subnet on Windows

PDF download Download Article
  1. The easiest way to find your subnet mask on Windows is to use a quick command in the command prompt. Press the Windows key, type Command , and then click Command Prompt in the search results.
  2. This displays the details of all of your active TCP/IP connections. [2]
  3. Look for "Subnet Mask" in the section below your network adapter. For example, if you're connected to Wi-Fi, you'll typically see an adapter called "Wireless LAN adapter" (or similar)—the subnet for your wireless connection appears here. The address you're looking for begins with 255.
  4. If you need to update the subnet mask on your PC due to changes in your network, it's easy. Note that you should only do this if you're using a static IP address that isn't assigned automatically:
    • Open your Windows Settings and select Network & Internet . [3]
    • For Wi-Fi, select Wi-Fi > Manage Known Networks. For Ethernet, select Ethernet , then choose your network.
    • Click Edit under "IP assignment."
    • Select Manual , then choose IPv4 .
    • Update your subnet mask and other details and save.
  5. Advertisement
Section 3 of 6:

Find the Subnet on Mac

PDF download Download Article
  1. You'll find the Apple menu at the top-left corner of your screen. [4]
  2. It's the globe icon in your System Preferences. [5]
  3. For example, if you want to find the subnet for your wireless connection, select Wi-Fi here. [6]
    • If you're using an ethernet connection, you will now see your IP address and subnet mask in the right panel. If you're using Wi-Fi, continue with this method to find your subnet mask.
  4. You'll see this button at the bottom-right corner.
  5. You'll see this at the top of the window. Here you'll find your IP address and subnet mask clearly labeled. The address you're looking for begins with 255.
    • If the only numbers you see are on the lower half of the screen underneath "Configure IPv6," you are on a local IPv6 network which does not use subnet masks. If you're having internet trouble, select Using DHCP from the drop-down menu, then click Renew DHCP Lease to receive a new IP address and subnet mask. [7]
  6. If you need to update the subnet mask on your Mac due to changes in your network, it's easy. Note that you should only do this if you're using a dedicated (static) IP address that must be configured manually:
    • Select the network in the Network panel of System Preferences.
    • Click Configure IPv4 in the menu, then select Manually .
    • Replace the current subnet mask with the new one and save your changes. [8]
  7. Advertisement
Section 4 of 6:

Find the Subnet on Linux

PDF download Download Article
  1. You can open a terminal by pressing Ctrl + Alt + T or by clicking the Terminal icon in your app list. [9]
  2. This displays the name of each of your network interfaces along with information about each connection. [10]
    • If you see "command not found," type whereis ifconfig to get the full path, such as /sbin/ifconfig , then simply type the full path to ifconfig and press Enter .
  3. Look for the "Mask" value next to the interface you're curious about, such as eth0 for ethernet or wlan0 for Wi-Fi. The subnet mask is typically labeled "Mask" and begins with 255.
  4. If your Linux workstation or server has a static IP address that isn't assigned automatically by the router by DHCP, you can use ifconfig to change the subnet mask. Here's how:
    • Find the adapter name for the connection you want to modify using ifconfig . For example, eth0 for your ethernet connection.
    • If the subnet mask is the only thing you need to change, use sudo ifconfig <adaptername> netmask <subnet mask> . [11]
    • For example, to change the subnet mask for the adapter wlan0 to 255.255.255.0, you'd use: sudo ifconfig wlan0 netmask 255.255.255.0 .
  5. Advertisement
Section 5 of 6:

Find the Subnet on Android

PDF download Download Article
  1. You can do this by tapping the Settings icon in your app list or by swiping down from the top of your Home screen and tapping the gear icon. [12]
    • The steps to view your subnet mask on Android will be a little different depending on your platform, such as Samsung Galaxy or stock Android.
  2. This option displays Wi-Fi information, such as whether you're connected and if any other networks are available. [13]
    • If you don't see this option, tap Network & Internet (or similar) and select Wi-Fi instead.
  3. Depending on your model, you may need to tap a gear icon to view the details. This displays your connection details, including your IP address and subnet mask, which begins with 255. [14]
    • If you don't see your subnet mask, tap Advanced or similar to show more options.
    • Some Androids connected through DHCP may not display the subnet mask at all. If you're not able to find the subnet mask with these steps, download Termux , a free terminal app, from the Play Store. Once downloaded, open the app, type ifconfig , and press Enter . You will see your subnet mask under "wlan0."
  4. If your Android has a static IP address and you need to update the subnet mask, it's pretty easy to do:
    • Select the Advanced or Manage option in your network's settings. If you don't see it, tap and hold the name of your wireless network in the list of networks, then tap Modify network .
    • Tap the IP Settings option if you see it—this is common on Samsung Galaxy models.
    • If DHCP is selected, you'll need to change it to Static . Then, you'll be able to modify the subnet mask, IP address, gateway, and other details.
  5. Advertisement
Section 6 of 6:

Find the Subnet on iPhone & iPad

PDF download Download Article
  1. You'll find this gear icon on your Home screen, in your app drawer, or by searching. [15]
  2. This option is near the top of the list. [16]
  3. You'll see it at the top of the screen below the "Wi-Fi" button. [17]
  4. Your subnet mask begins with 255 and is just below your IP address about halfway down the page.
  5. If your iPhone or iPad has a static IP address and you need to update the subnet mask, it's pretty easy to do from this screen:
    • Just above your IP address, tap Configure IP .
    • If you have a static IP address already, you'll see the option to modify the subnet mask here. If not, you can tap Manual and enter your new static IP address information, including your subnet and gateway address (referred to here as "router").
  6. Advertisement

Expert Q&A

Search
Add New Question
  • Question
    Why do I have the same subnet mask on multiple devices?
    Stan Kats
    Professional Technologist
    Stan Kats is a Professional Technologist and the COO and Chief Technologist for The STG IT Consulting Group in West Hollywood, California. Stan provides comprehensive technology solutions to businesses through managed IT services, and for individuals through his consumer service business, Stan's Tech Garage. Stan holds a BA in International Relations from The University of Southern California. He began his career working in the Fortune 500 IT world. Stan founded his companies to offer an enterprise-level of expertise for small businesses and individuals.
    Professional Technologist
    Expert Answer
    Are the last four digits 2550? That's the subnet mask for most consumer class devices, so it'd make sense if you see the same subnet mask on multiple devices.
  • Question
    Is this process the same on any device?
    Stan Kats
    Professional Technologist
    Stan Kats is a Professional Technologist and the COO and Chief Technologist for The STG IT Consulting Group in West Hollywood, California. Stan provides comprehensive technology solutions to businesses through managed IT services, and for individuals through his consumer service business, Stan's Tech Garage. Stan holds a BA in International Relations from The University of Southern California. He began his career working in the Fortune 500 IT world. Stan founded his companies to offer an enterprise-level of expertise for small businesses and individuals.
    Professional Technologist
    Expert Answer
    It's going to be different from operating system to operating system. But if you have two Windows computers, for example, it should be the same.
  • Question
    How do you do this on a Mac?
    Stan Kats
    Professional Technologist
    Stan Kats is a Professional Technologist and the COO and Chief Technologist for The STG IT Consulting Group in West Hollywood, California. Stan provides comprehensive technology solutions to businesses through managed IT services, and for individuals through his consumer service business, Stan's Tech Garage. Stan holds a BA in International Relations from The University of Southern California. He began his career working in the Fortune 500 IT world. Stan founded his companies to offer an enterprise-level of expertise for small businesses and individuals.
    Professional Technologist
    Expert Answer
    Go into your system preferences and select "networks." Pick whatever device you want to find the subnet mask for and open it. There should be a tab for IP addresses in that window. Your subnet mask will be listed there alongside the IP.
See more answers
Ask a Question
      Advertisement

      Video

      Tips

      • If your subnet mask reads all zeros (0.0.0.0), you may not have an active Internet connection.
      • When devices on a network communicate, they check to see if the address they're trying to reach is in the same subnet range. If the address is in range, the devices can communicate without much help from the router. If the address is in another range, the router routes the traffic to the proper subnet.
      • IPv6–only networks do not use subnet masks. The subnet ID is built into the IP address instead. The fourth group of digits separated by colons describes your subnet (or the 49th–64th binary digits).
      Show More Tips
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!
      Advertisement

      About This Article

      Thanks to all authors for creating a page that has been read 918,411 times.

      Reader Success Stories

      • Anonymous

        Jun 24, 2016

        "Very easy to read and follow directions. Found it as it said right away. Thank you for your help."
      Share your story

      Is this article up to date?

      Advertisement