Understanding subnetwork mask can be confusing if you’re not used to them. You may find “ipcalc” (from ipcalc package) useful to calculate a computer network’s mask.
First start by installing “ipcalc” from the repositories, depending on your distro:
sudo apt-get install ipcalc #for debian distros like ubuntu yum install ipcalc #for fedora
then find the ip address for which you want to calculate the network for, and enter it along with “ipcalc” command
[root@Fedora11-vbox ~]# ipcalc -bmn 192.168.10.122/22 NETMASK=255.255.252.0 BROADCAST=192.168.11.255 NETWORK=192.168.8.0
So in this scenario, the subnetmask is (255.255.252.0), the broadcast address (192.168.11.255), which means that the last usable ip address for that network is (192.168.11.254), and last the network address (192.168.8.0); therefore, the first ip address for that range will be (192.168.8.1).