Lulu Harper
Lulu Harper

Reputation: 19

Calculate Subnet mask from IP address range manually

How can I calculate Subnet mask from IP address range manually?

For example IP addresses from 212.92.32.00 to 212.92.63.255, what is the mask in decimal dot format?

Upvotes: -2

Views: 2206

Answers (2)

an_v
an_v

Reputation: 11

This IP range belongs to Class C means N.N.N.H (N means Network ID's and H means Host ID's) and Default Class C subset mask 255.255.255.0. In binary format 11111111 11111111 11111111 00000000. Here 8 Host bits 2x2x2x2x2x2x2x2 = 256 (usable 254 only because 2 hosts not usable one for Network and one for Broadcast) Now first sub-net as follows:

Network:   212.92.32.0/24
Broadcast: 212.92.32.255
HostMin:   212.92.32.1 ----- (usable IP starting)
HostMax:   212.92.32.254 -----(usable IP ending)
Netmask:   255.255.255.0
Hosts/Net: 254

and up-to 212.92.63.255.

Upvotes: 0

Konstantin Shemyak
Konstantin Shemyak

Reputation: 2527

The first and the last IPv4 addresses of the subnet satisfy the following:

  • they have identical first N bits
  • the first address has remaining (32-N) bits equal to 0
  • the last address has remaining (32-N) bits equal to 1

In this case, the netmask is simply /N. In your example, the addresses are:

11010100.01011100.00100000.00000000 and

11010100.01011100.00111111.11111111

so:

  • your addresses have first 19 bits equal
  • the first address has last 13 bits equal to 0
  • the last address has last 13 bits equal to 1

So, your netmask is /19, or 11111111.11111111.11100000.00000000, or 255.255.224.0.

Upvotes: 1

Related Questions