-3

It is small question, but I can't figure out these things. Please help me in simply way how to do this.

Consider the given ip address is 198.51.100.39/28. From this how can I found the first ,last and the number of address in this network

2
  • 1
    See How do you calculate the prefix, network, subnet, and host numbers?. It is simple binary math.
    – Ron Maupin
    Jun 23, 2018 at 10:07
  • If you have a linux machine - install ipcalc $ ipcalc 198.51.100.39/28 Address: 198.51.100.39 11000110.00110011.01100100.0010 0111 Netmask: 255.255.255.240 = 28 11111111.11111111.11111111.1111 0000 Wildcard: 0.0.0.15 00000000.00000000.00000000.0000 1111 => Network: 198.51.100.32/28 11000110.00110011.01100100.0010 0000 HostMin: 198.51.100.33 11000110.00110011.01100100.0010 0001 HostMax: 198.51.100.46 11000110.00110011.01100100.0010 1110 Broadcast: 198.51.100.47 11000110.00110011.01100100.0010 1111 Jun 23, 2018 at 10:47

1 Answer 1

0

The math behind requires converting IPv4 notation and CIDR block into binary.

198.51.100.39    in binary  11000110 00110011 01100100 00100111
255.255.255.240  (for /28)  11111111 11111111 11111111 11110000
---------------------------------------------------------------
FIRST (from logical AND)    11000110 00110011 01100100 00100000
LAST  (host bits => 1)      11000110 00110011 01100100 00101111

These converted back into IPv4 notation gives range 198.51.100.32 - 198.51.100.47.

The number of addresses can be calculated directly from CIDR (/28): 2³²⁻²⁸ = 2⁴ = 16.

If you don't want to do this every time, you can use a CIDR to IPv4 Conversion tool.

Not the answer you're looking for? Browse other questions tagged .