Difference between revisions of "What is a Netmask?"

From Teltonika Networks Wiki
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
A '''Netmask''' is a 32-bit "mask" used to divide an IP address into subnets and specify the network's available hosts. In a netmask, two bits are always automatically assigned. For example, in 255.255.225.0, "0" is the assigned network address. In 255.255.255.255, "255" is the assigned broadcast address. The 0 and 255 are always assigned and cannot be used.
 
A '''Netmask''' is a 32-bit "mask" used to divide an IP address into subnets and specify the network's available hosts. In a netmask, two bits are always automatically assigned. For example, in 255.255.225.0, "0" is the assigned network address. In 255.255.255.255, "255" is the assigned broadcast address. The 0 and 255 are always assigned and cannot be used.
  
Netmask defines how "large" a network is or if you're configuring a rule that requires an IP address and a Netmask, the Netmask will signify to what range of the Network the rule will apply to:
+
Netmask defines how "large" a network is or if you're configuring a rule that requires an IP address and a Netmask, the Netmask will signify to what portion or range of the Network the rule will apply to:
  
<table class="nd-othertables">
+
{| class="wikitable"
    <tr>
+
|+
        <th style="width: 200px">IP</th>
+
! style="width: 200px; background: black; color: white;" | IP
      <th style="width: 200px">NETMASK</th>
+
! style="width: 200px; background: black; color: white;" | Netmask
      <th style="width: 400px">DESCRIPTION</th>
+
! style="width: 200px; background: black; color: white;" | Description
    </tr>
+
|-
    <tr>
+
! style="text-align: left; vertical-align: top;" | 192.168.55.161
      <td>192.168.55.161</td>
+
| style="text-align: left; vertical-align: top;" | 255.255.255.255
      <td>255.255.255.255</td>
+
| style="text-align: left; vertical-align: top;" | Only applies to 192.168.55.161'''
      <td>Only applies to 192.168.55.161</td>
+
|-
    </tr>
+
! style="text-align: left; vertical-align: top;" | 192.168.55.0
    <tr>
+
| style="text-align: left; vertical-align: top;" | 255.255.255.0
      <td>192.168.55.0</td>
+
| style="text-align: left; vertical-align: top;" | Applies to IPs in the 192.168.55.0 - 192.168.55.255 range
      <td>255.255.255.0</td>
+
|-
      <td>Applies to IPs in the 192.168.55.0 - 192.168.55.255 range</td>
+
! style="text-align: left; vertical-align: top;" | 192.168.55.240
    </tr>
+
| style="text-align: left; vertical-align: top;" | 255.255.255.240
    <tr>
+
| style="text-align: left; vertical-align: top;" | 192.168.55.240 - 192.168.55.255
    <td>192.168.55.240</td>
+
|-
        <td>255.255.255.240</td>
+
! style="text-align: left; vertical-align: top;" | 192.168.55.161
        <td>192.168.55.240 - 192.168.55.255</td>
+
| style="text-align: left; vertical-align: top;" | 255.255.255.0
    </tr>
+
| style="text-align: left; vertical-align: top;" | 192.168.55.0 - 192.168.55.255
    <tr>
+
|-
    <td>192.168.55.161</td>
+
! style="text-align: left; vertical-align: top;" | 192.168.0.0
        <td>255.255.255.0</td>
+
| style="text-align: left; vertical-align: top;" | 255.255.0.0
        <td>192.168.55.0 - 192.168.55.255</td>
+
| style="text-align: left; vertical-align: top;" | 192.168.0.0 - 192.168.255.255
    </tr>
+
|-
    <tr>
+
|}
    <td>192.168.0.0</td>
 
        <td>255.255.0.0</td>
 
        <td>192.168.0.0 - 192.168.255.255</td>
 
    </tr>
 
</table>
 
  
 +
Sometimes you will see a Netmask that is defined by one number, e.g., '''24'''. This number is a the length of the Netmask in bits:
  
Sometimes you will see that a Netmask is defined by one number, e.g., '''24'''. This number is the length of the Netmask in bits:
+
{| class="wikitable"
 
+
|+
<table class="nd-othertables">
+
! style="width: 200px; background: black; color: white;" | Netmask
    <tr>
+
! style="width: 200px; background: black; color: white;" | 255.
        <th style="width: 200px">NETMASK</th>
+
! style="width: 200px; background: black; color: white;" | 255.
      <th style="width: 100px">255.</th>
+
! style="width: 200px; background: black; color: white;" | 255.
      <th style="width: 100px">255.</th>
+
! style="width: 200px; background: black; color: white;" | 255
      <th style="width: 100px">255.</th>
+
|-
      <th style="width: 100px">255</th>
+
! style="text-align: left; vertical-align: top;"  | Netmask length
    </tr>
+
| style="text-align: center; vertical-align: top;" | 8
    <tr>
+
| style="text-align: center; vertical-align: top;" | 16
      <td>Netmask length</td>
+
| style="text-align: center; vertical-align: top;" | 24
      <td>8</td>
+
| style="text-align: center; vertical-align: top;" | 32
      <td>16</td>
+
|-
      <td>24</td>
+
|}
      <td>32</td>
 
    </tr>
 
</table>
 
 
 
  
 
So, for example, a Netmask that is 24-bits long is '''255.255.255.0''':
 
So, for example, a Netmask that is 24-bits long is '''255.255.255.0''':
  
<table class="nd-othertables">
 
    <tr>
 
        <th style="width: 200px">NETMASK</th>
 
      <th style="width: 100px">255.</th>
 
      <th style="width: 100px">255.</th>
 
      <th style="width: 100px">255.</th>
 
      <th style="width: 100px">0</th>
 
    </tr>
 
    <tr>
 
      <td>Netmask length</td>
 
      <td>8</td>
 
      <td>16</td>
 
      <td>24</td>
 
      <td>-</td>
 
    </tr>
 
</table>
 
 
 
A Netmask that is 16-bits long is '''255.255.0.0''':
 
 
<table class="nd-othertables">
 
    <tr>
 
        <th style="width: 200px">NETMASK</th>
 
      <th style="width: 100px">255.</th>
 
      <th style="width: 100px">255.</th>
 
      <th style="width: 100px">0.</th>
 
      <th style="width: 100px">0</th>
 
    </tr>
 
    <tr>
 
      <td>Netmask length</td>
 
      <td>8</td>
 
      <td>16</td>
 
      <td>-</td>
 
      <td>-</td>
 
    </tr>
 
</table>
 
 
And so on.
 
  
[[Category:Networking]]
+
{| class="wikitable"
 +
|+
 +
! style="width: 200px; background: black; color: white;" | Netmask
 +
! style="width: 200px; background: black; color: white;" | 255.
 +
! style="width: 200px; background: black; color: white;" | 255.
 +
! style="width: 200px; background: black; color: white;" | 255.
 +
! style="width: 200px; background: black; color: white;" | 0
 +
|-
 +
! style="text-align: left; vertical-align: top;"  | Netmask length
 +
| style="text-align: center; vertical-align: top;" | 8
 +
| style="text-align: center; vertical-align: top;" | 16
 +
| style="text-align: center; vertical-align: top;" | 24
 +
| style="text-align: center; vertical-align: top;" | -
 +
|-
 +
|}

Revision as of 10:41, 16 January 2018

Main Page > FAQ > Networking > What is a Netmask?

A Netmask is a 32-bit "mask" used to divide an IP address into subnets and specify the network's available hosts. In a netmask, two bits are always automatically assigned. For example, in 255.255.225.0, "0" is the assigned network address. In 255.255.255.255, "255" is the assigned broadcast address. The 0 and 255 are always assigned and cannot be used.

Netmask defines how "large" a network is or if you're configuring a rule that requires an IP address and a Netmask, the Netmask will signify to what portion or range of the Network the rule will apply to:

IP Netmask Description
192.168.55.161 255.255.255.255 Only applies to 192.168.55.161
192.168.55.0 255.255.255.0 Applies to IPs in the 192.168.55.0 - 192.168.55.255 range
192.168.55.240 255.255.255.240 192.168.55.240 - 192.168.55.255
192.168.55.161 255.255.255.0 192.168.55.0 - 192.168.55.255
192.168.0.0 255.255.0.0 192.168.0.0 - 192.168.255.255

Sometimes you will see a Netmask that is defined by one number, e.g., 24. This number is a the length of the Netmask in bits:

Netmask 255. 255. 255. 255
Netmask length 8 16 24 32

So, for example, a Netmask that is 24-bits long is 255.255.255.0:


Netmask 255. 255. 255. 0
Netmask length 8 16 24 -