Let's assume I don't know what my IP range is, or my default gateway, but I know my IP address is 192.168.5.38 and my CIDR Range is /23.
How do I know what my IP range is?
Is my range
192.168.4.0-192.168.5.255
or
192.168.5.0-192.168.6.255
Can we only work out this if we know the default gateway?
Please note I'm not asking what tools can provide this information, this is a thought exercise. I'm trying to understand how you would know the range when faced with a situation like this.
Thanks!
Answer:
thanks to @g_bor down below - they helped me understand how you work out the range. You do it by ANDing the binary outputs of both IP address and Subnet mask.
IP address: 192.168.5.38
Binary
11000000.10101000.00000101.00100110
Subnet Mask: /23 (255.255.254.0)
Binary:
11000000.10101000.00000100.00000000
If we AND them together (1 AND 1 = 1, 0 AND 0 = 0, 1 AND 0 = 0) we get
11000000.10101000.00000100.00000000
which is IP Range:
192.168.4.0