• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Quick Question about Netmasks

Status
Not open for further replies.

Kenji4861

Banned
I'm trying to understand how to read netmasks.

If I was told to make sure I have IP 1.2.0.0/16 whitelisted, would that cover 1.2.3.4?
I just want to make sure it covers 1.2.0.0 all the way up to 1.2.255.255

I would think it does since 255.255.(8 bit).(8 bit)
and 8 bit goes up to 256.

Any help would be appreciated.
 
/16 is 16 bits of mask so the first two octets would need to remain the same, so you're correct it covers 1.2.0.0 - 1.2.255.255
 
For an address you need both an IP address and a subnet mask.

the subnet mask is what tells your computer which portion of the IP address identifies the network, and which part of the IP address identifies the local address. A /16 means the first 16 bits from the left in your IP address are the network part. The remaining 2 octets to the right, in this case, can be part of useable IP addresses for your computers, printers, digital projectors, pda's, etc.

A /16 (alternatively called CIDR /16) subnet mask means the first 16 bits are all "1"s. If you put the number 255 into a calculator and convert it to binary you will see that 255 in the ordinary decimal numbering we use every day converts into eight "1"'s. That's 8 bits of "1".
255 in decimal = 11111111 in binary.

In other words, the mask /16 tells your computer that your subnet mask is 255.255.0.0. It calculates that /16 can have up to 256 different subnets, and up to 65,536 different host addresses per each one of those subnets, of which 65,534 are actually useable. The nonuseable addresses are for the broadcast adress and the "zero subnet", which may or may not be not assignable by you.

It doesn't have to be /16, it can be /17 or /19 or ...

The 1 means the corresponding bit in the IP address identifies the network.

IP address: ........188.10.18.2 (say, to pick a random example)
Subnet mask: .....255.255.0.0 (first 2 octets are all "255" to human eyes, but are all "1" to your computer)

So in the above example, the network address is 188.10.0.0. An individual IP address on that network is the 188.10.18.2.

In other words, the numbers above are for human convenience only. The computer only sees them in binary.

In the binary that the dumb computer understands:
IP address: ........188.10.18.2 = 10111100.00001010.00010010.00000010
Subnet mask: .....255.255.0.0 = 11111111.11111111.00000000.00000000

An address like /16 would be assigned to a gigantic corporation like General Electric, and they then subnet it down into thousands of useable addresses.

Usually when we the peeps pay an ISP for service they assign us a subnet mask of 255.25.255.0, which can alternatively be written as /24 in the CIDR notation. In other words, the ISP is using the first 24 bits for it's network (because it can subnet that down into tens of thousands of assignable addresses it can sell), and you are buying the use of the last 8 bits which you can use to assign IP addresses to your various equipment.

There's a lot more to it than that. For more, read up on "subnetting", or Cisco even has a free subnetting game you can play to help you learn this stuff https://cisco.hosted.jivesoftware.com/docs/DOC-1802">here.</a> 🙂
Text
 
Status
Not open for further replies.
Back
Top