Here I am running an application on a computer, host=localhost, the application runs on localhost:5000, or 127.0.0.1:5000.
- When the computer accesses 127.0.0.0/8, or 127.0.0.0 subnet mask 255.0.0.0, does it refer to itself somehow? That is, I enter 127.0.0.1:5000 into the browser and since it corresponds to the mask 127.0.0.0/8, it refers to itself and receives a response from itself?
- If you put host=0.0.0.0, it says that the application is running on a host that is in the local network. That is, before it was launched on the host 127.0.0.1, and now it is launched on, for example, the address 192.168.0.2:5000, subnet mask 255.255.255.0. Why if host=0.0.0.0.0, it starts referring to the local IP address, and not to 0.0.0.0? And also, it turns out that inside his subnet I will refer to his local IP address, and outside this subnet to the public one? That's what I was thinking, why if it runs on 192.168.0.2:5000, then for devices on his subnet they will connect on his local IP, but I connect to it using his public IP, since I'm not on his subnet?
- I don't quite understand how the subnet mask works. For example, in the example 192.168.0.1/24 everything is clear, there are 24 units and they will give 192.168.0, and under the last octet will be values from 0 to 255, that is, fix the first three octets, and the last octet is completely free.But if 192.168.11.10/21, there are 16 units, then 5 units, remains then 3 zeros and 8 zeros, as a result, the subnet mask will be 192.168.8.0 and the values will be between 192.168.8.0 to 192.168.15.255. Now I will try to figure out the same logic - 16 units, so the first two octets remain the same, then there are 5 units and one unit in 11, that is 00001011 in binary, is left with one unit and remains 00001000 and the values will be from 00001000 to 00001111. But I am surprised that for 192.168.7.12/24 the values will be from 192.168.0.0 to 192.168.7.255, that is completely different addresses, and I thought that they will be in the same subnet with 192.168.8.11