446
This Phishing email... What is the IP?
(programming.dev)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Long story short? The subnet mask determines which numbers can change. A mask of 255 means there is no change. A mask of 0 means any number can change. So for instance, a range of
192.168.1.0with a mask of255.255.255.0will only find other devices in the192.168.1.xrange. Because the last octet is the only one that isn’t 255.And writing the range as
192.168.1.0/24is simply a shorter way to accomplish the same thing. Each group of numbers is an octet made of 8 bits. So masking the first 8 bits (255.0.0.0) is /8. Masking the first 16 bits (255.255.0.0) is /16, and masking the first 24 bits (255.255.255.0) is /24. So192.168.1.0/16would be able to find anything in the192.168.x.xrange.If you want to get really deep in it, you can manually calculate subnet masks. Remember that computers work in binary, and the octets are each a group of 8 bits. For example, the IP address
192.168.42.67could also be written as00000011.00010101.01010100.11000010but that’s a nightmare for humans to remember so we use base 10 by default.The subnet mask tells the computer which bits may be different. So a subnet mask of 255.255.255.0 looks like this:
11111111.11111111.11111111.00000000. So the computer will only scan for neighbors on any bits that are 0’s (unmasked). So in this case, if the range is 192.168.42.0/24, it will assume that the first three octets (192, 168, and 42, respectively) are going to match. So it will only scan for differences in the last octet.Wait, that actually made sense? I kinda knew some of this but now it all commceted makes sense. thanks lol