Answer the question
In order to leave comments, you need to log in
How to check if an ip address belongs to a specific subnet?
Greetings, I didn’t find a clear explanation on the network on how to determine whether the IP address belongs to a specific subnet, how to find the network address, broadcast or match the logical "AND" IP and the mask, I know! Here is an example: which subnet belongs to ipi 10.120.100.255/18 address options
1) 10.120.0.100
2) 10.0.0.0
3) 10.120.64.0
4) 10.120.96.0
PS I do not need a solution, I need the correct calculation algorithm.
Answer the question
In order to leave comments, you need to log in
10.120.100.255/18
First represent the address and mask in binary form
00001010.01111000.01100100.11111111/11111111.11111111.11000000.00000000
Then bitwise AND the mask and address.
00001010.01111000.01000000.00000000
Then convert back to decimal.
10.120.64.0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question