When I get lost with network addresses (I agree, it is not easy to calculate those /26 or /27s), I just ask the ipcalc tool to do the math for me. But be careful, because ipcalc
in CentOS/RHEL is a completely different tool.
You run ipcalc
and pass it some kind of network address as an argument and it gives you all kinds of useful self-explanatory information (looking at the binary netmask you can understand what a valid network address is in such a way that you will remember it). Taking your first address as an example (the space before the slash is optional).
$ ipcalc 172.16.4.127 /26
Address: 172.16.4.127 10101100.00010000.00000100.01 111111
Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Wildcard: 0.0.0.63 00000000.00000000.00000000.00 111111
=>
Network: 172.16.4.64/26 10101100.00010000.00000100.01 000000
HostMin: 172.16.4.65 10101100.00010000.00000100.01 000001
HostMax: 172.16.4.126 10101100.00010000.00000100.01 111110
Broadcast: 172.16.4.127 10101100.00010000.00000100.01 111111
Hosts/Net: 62 Class B, Private Internet
So in your case, 172.16.4.127 is the broadcast for the 172.16.4.64/26 network. And for a complete answer:
- 172.16.4.127/26
- Network: 172.16.4.64/26
- Broadcast: 172.16.4.127
- 172.16.4.155/26
- 172.16.4.193/26
- Network: 172.16.4.192/26
- HostMin: 172.16.4.193
- 172.16.4.95/27
- Network: 172.16.4.64/27
- Broadcast: 172.16.4.95
- 172.16.4.159/27
- Network: 172.16.4.128/27
- Broadcast: 172.16.4.159
- 172.16.4.207/27