You can write a subnet mask in 3 ways:
- in binary, the real notation, but never used in practice since it is not really practical, for example
11111111111111111111110000000000
or 11111111111111111111111100000000
- with the slash notation it is written as
/22
or /24
- in decimal, it will be
255.255.252.0
or 255.255.255.0
As you can see the 22
or 24
noted after the slash is simply the count of contiguous 1.
The decimal notation divides the 32 bits in four octets and convert them from binary to decimal and write them separated by points, the same way an IP address is written in decimal.
Personally I would never write 255.255.252/22
which only cause confusion, because it looks like an IP address assigned to an interface rather than a subnet mask.
In a documentation / procedure, I would write it 255.255.252.0 (/22)
, which give the same information in 2 different formats, so the reader can choose the format it prefers or avoid the pain to convert from one to another.
When you configure a device you will always use a single format.
Some devices only accept the "slash" notation, will other only accept the decimal notation, and some can use both (but one at a time).
If you must enter a subnet, an IP address and a gateway this would be:
Subnet: 10.16.192.0/22
Address: 10.16.192.251
Gateway: 10.16.192.1
(But this is a bit odd since you have the gateway IP that is somewhere in the subnet, usually it will be the first or the last address of the subnet)