L
L
LittleFatNinja2015-05-28 23:14:08
PHP
LittleFatNinja, 2015-05-28 23:14:08

How to find out the maximum ip in a subnet?

there is an ip and a mask, let's say
192.62.0.0/24
, in theory, you need to get the number of possible ip and add
it to the network ip. In this case, do I need to convert the mask / 24 to the CIDR type?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
M
Maxim Moseychuk, 2015-05-29
@LittleFatNinja

addr & mask | ~mask

M
microphone, 2015-05-28
@microphone

Dear friend, you need to learn the basics of local area networks

M
Maxim Prigozhenkov, 2015-05-28
@Waka_Waka

11111111.11111111.11111111.11111111 = 255.255.255.255 = 32 // But this does not happen
11111111.11111111.11111111.00000000 = 255.255.255.0 = 24
11111111.11111111.00000000.00000000 = 255.255.0.0 = 16
11111111.00000000.00000000.00000000 = 255.0.0.0 = 8
That's how much you have units, this mask and will be

S
sbh, 2015-05-29
@sbh

If you are too lazy to read and understand or time does not allow yet, use the ip calculator. Google to the rescue.

N
Nik, 2015-06-01
@Lastok

The 255th octet will be the last, but it is broadcast, so the maximum is 254. It's simple. And in general it is necessary to study Fundamentals of a LAN.

R
res2001, 2015-06-05
@res2001

Now classful addressing is no longer used in practice - CIDR is everywhere. If you see a mask, it means CIDR.
The wiki has a good article on CIDR .
See last table and comment below.
In your case, \24 means a maximum of 254 hosts.
You can add a new subnet to an existing one through a router that is connected to both networks (has an address on both networks), it will be the default gateway for the hosts of the new network. In order for a host on an existing network to see hosts on a new network, one generally needs to add a route to that new network to that host's routing table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question