Simula Research Laboratory / Center for Resilient Networks and Applications / NorNet
Homepage of Thomas Dreibholz / SubNetCalc Homepage


SubNetCalc
An IPv4/IPv6 Subnet Calculator

Screenshot of SubNetCalc run


πŸ“‘ Quick Navigation


πŸ“° Latest News


πŸ’‘ What is SubNetCalc?

SubNetCalc is an IPv4/IPv6 subnet address calculator. For given IPv4 or IPv6 address and netmask or prefix length, it calculates network address, broadcast address, maximum number of hosts and host address range. Also, it prints the addresses in binary format for better understandability. Furthermore, it prints useful information on specific address types (e.g. type, scope, interface ID, etc.).


πŸ˜€ Examples


πŸ“¦ Binary Package Installation

Please use the issue tracker at https://github.com/dreibh/subnetcalc/issues to report bugs and issues!

Ubuntu Linux

For ready-to-install Ubuntu Linux packages of SubNetCalc, see Launchpad PPA for Thomas Dreibholz!

sudo apt-add-repository -sy ppa:dreibh/ppa
sudo apt-get update
sudo apt-get install subnetcalc

Fedora Linux

For ready-to-install Fedora Linux packages of SubNetCalc, see COPR PPA for Thomas Dreibholz!

sudo dnf copr enable -y dreibh/ppa
sudo dnf install subnetcalc

FreeBSD

For ready-to-install FreeBSD packages of SubNetCalc, it is included in the ports collection, see FreeBSD ports tree index of net/subnetcalc/!

sudo pkg install subnetcalc

Alternatively, to compile it from the ports sources:

cd /usr/ports/net/subnetcalc
make
sudo make install

πŸ’Ύ Build from Sources

SubNetCalc is released under the GNU General Public Licence (GPL).

Please use the issue tracker at https://github.com/dreibh/subnetcalc/issues to report bugs and issues!

Development Version

The Git repository of the SubNetCalc sources can be found at https://github.com/dreibh/subnetcalc:

git clone https://github.com/dreibh/subnetcalc
cd subnetcalc
sudo ci/get-dependencies --install
cmake .
make

Optionally, for installation to the standard paths (usually under /usr/local):

sudo make install

Note: The script ci/get-dependencies automatically installs the build dependencies under Debian/Ubuntu Linux, Fedora Linux, and FreeBSD. For manual handling of the build dependencies, see the packaging configuration in debian/control (Debian/Ubuntu Linux), subnetcalc.spec (Fedora Linux), and Makefile FreeBSD.

Contributions:

Current Stable Release

The tarball has been signed with my GnuPG key 21412672­518D8B2D­1862EFEF­5CD5D12A­A0877B49. Its authenticity and integrity can be verified by:

gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 21412672518D8B2D1862EFEF5CD5D12AA0877B49
gpg --verify subnetcalc-<VERSION>.tar.xz.asc subnetcalc-<VERSION>.tar.xz

Old Stable Releases

The tarballs have been signed with my GnuPG key 21412672­518D8B2D­1862EFEF­5CD5D12A­A0877B49. Its authenticity and integrity can be verified by:

gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 21412672518D8B2D1862EFEF5CD5D12AA0877B49
gpg --verify subnetcalc-<VERSION>.tar.xz.asc subnetcalc-<VERSION>.tar.xz

🌏 Internationalisation

To provide a translation of SubNetCalc into your language, apply the following steps:

  1. Build SubNetCalc from the Git sources (see Development Version), i.e. use the β€œmaster” branch with the latest development version. The build will create a .pot (translation template) file under po.

  2. Create a new Git branch for your translations, e.g. my_username/translations_language_XX (with XX the language code for your language, e.g. da for Danish):

    git branch my_username/translations_language_XX
    git checkout my_username/translations_language_XX
  3. Take a look at the existing .po files (translations files) in po/de (German) and po/nb (BokmΓ₯l) as examples, e.g. po/de/subnetcalc.po or po/nb/subnetcalc.po. Then, prepare a translation for your language XX under po:

    mkdir -p XX
    msginit --input subnetcalc.pot \
            --locale XX.UTF-8 \
            --output-file XX/subnetcalc.po
    git add XX/subnetcalc.po
  4. Add your translations into XX/subnetcalc.po, with a text editor or PO file editor like Poedit.

  5. Test, commit and push your changes.

  6. Finally, make a pull request: https://github.com/dreibh/subnetcalc/pulls.