What is the difference between 192.168.2.1/24 and 192.168.1.1/24?
Is two different network segments, the subnet mask is 24,
The first value range is 192.168.2.1 ~ 255,
The second value ranges from 192.168.1.1 ~ 255
These are two CIDR blocks. The last 24 indicates that its subnet mask is 255.255.255.0.
Continue to ask: why is the mask the same but not the same CIDR Block?
The third segment of their IP addresses is different ..
The mask is only used to determine the number of host bits in a CIDR block.
Ifconfig eth0 192.168.0.1 netmask 255.255.255.0
Ifconfig br0 192.168.0.1 netmask 255.255.255.0
-------------------------------------------------------------
1111 1111. 1111 1111. 1111 1111. ******** // The Sub-code mask is a 32-bit binary system.
255.255.255.x // decimal representation
The correct mask can only be an available IP Address
0 (0 ~ 255)
128 = 128 255-128 = <127 -- 0> // 192.168.1. (0 ~ 127)
128 + 64 = 192 255-192 = <63 -- 0>
128 + 64 + 32 = 224 255-224 = <31 -- 0>
128 + 64 + 32 + 16 = 240 255-240 = <15 -- 0>
128 + 64 + 32 + 16 + 8 = 248 255-248 = <7 -- 0>
128 + 64 + 32 + 16 + 8 + 4 = 252 255-252 = <3 -- 0>
128 + 64 + 32 + 16 + 8 + 4 + 2 = 254 255-254 = <1 -- 0>
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 255-255 = <0 -- 0>
-------------------------------------------------------------