Binary package “netmask” in ubuntu bionic

helps determine network masks

 This is a tiny program handy if you work with firewalls or routers
 occasionally (possibly using this as a helper for shell scripts). It can
 determine the smallest set of network masks to specify a range of hosts.
 It can also convert between common IP netmask and address formats.