I try to install a server from scratch with a fixed IP address. For installation I use the provided ISO of 18.04.3 and the installation agent of Ubuntu.
First I thought that my understanding of the subnet CIDR was wrong, but after I received credible information from https://networkengineering.stackexchange.com/questions/63499/how-to-interpret-subnet-mask
I am sure that this is more a problem within Ubuntu.
When I enter 255.255.252.0/22
as subnet CIDR and 10.16.192.252
as the IP address I get the error message that 10.16.192.251 is not contained in 255.255.252.0/22
. But a subnet calculator tells me that 10.16.192.1 - 10.16.195.254
would be part of the subnet.
The prompt wants a network address with CIDR prefix. That is, if you are using
10.16.192.251/22
for your network (255.255.252.0 subnet mask, /22 CIDR mask), you need to first calculate the network address (the first IP of the range, usually a .0 with ones like this in the last subnet, but could be a different third octet, in this case 10.16.192.0 is the network address) and then put that in forsubnet
with the CIDR mask.Therefore, use
10.16.192.0/22
for the Subnet field. This is used to autocalculate Broadcast address and Gateway address on a 'default' network, but in the case here also makes sure that the Address you enter is in fact in the subnet you're looking to add it to.You can specify a subnet mask in different ways: Separate from the IP address, or in combination with it. You're doing both at the same time ;)
The subnet mask
255.255.252.0
is, written in binary,11111111.11111111.11110000.00000000
. That basically means, the front 22 bits are fixed for all IP addresses in this subnet, only the last ten bits can vary. So the subnet encompasses IP addresses from10.16.192.0
to10.16.195.255
. The first and the last addresses in those range have special purposes, so host systems can have IP addresses from10.16.192.1
to10.16.195.254
.The other way to specify the subnet mask is to just write the number of fixed bits after the IP address, separated by a slash. In this case, the first 22 bits are fixed, so the so-called CIDR notation would be
10.16.192.251/22
.So you can write the IP address and the subnet as either
or as
but not both at the same time. And in any case, you don't combine one notation of the subnet mask with another notation of the subnet mask, as you've done in 255.255.252.0/22 ;)