subnetcalc(1)

πŸ’– NAME πŸ’–

okay bestie, meet subnetcalc β€” it's the IPv4/IPv6 Subnet Calculator and it lives in the General Commands Manual (that's section 1, iykyk πŸ’…). she does math so you don't have to, and she does it gloriously.


✨ SYNOPSIS ✨

subnetcalc address/prefix | address/netmask | address prefix | address
           netmask
           [-u | --uniquelocal] [-U | --uniquelocalhq]
           [-n | --noreverselookup]
           [-g | --nogeoiplookup]
           [-c | --nocolour | --nocolor]
subnetcalc [-h | --help]
subnetcalc [-v | --version]

🌸 DESCRIPTION 🌸

so basically? subnetcalc is an IPv4/IPv6 subnet address calculator, and she eats. πŸ“

you hand her an IPv4 or IPv6 address plus a netmask or a prefix length, and she calculates:

  • the network address
  • the broadcast address
  • the maximum number of hosts
  • the host address range

and that's not even the whole meal πŸ’…. she also prints the addresses in binary format, because seeing the bits literally makes it click better (no cap). on top of that she drops useful info about specific address types β€” type, scope, interface ID, etc. β€” like the kind of notes your bestie slides you in the group chat right before a quiz. πŸ“


πŸŽ€ ARGUMENTS πŸŽ€

these are the things you can hand her:

  • address β€” the IP address. if you put a hostname here instead, she'll try to resolve it through a DNS server and just use the first address that comes back. Internationalized Domain Names (IDN) are supported, so yes, your fancy ΓΌ's and Γ₯'s are welcome here πŸ¦‹.
  • netmask β€” the netmask. that's it, that's the whole job.
  • prefix β€” the prefix length. ranges from 0-32 for IPv4 and 0-128 for IPv6.
  • -u | --uniquelocal β€” give her an IPv6 address and she swaps the first 48 bits for a randomly chosen IPv6 Unique Local prefix inside fc00::/7 (see also RFC 4193). on Linux and FreeBSD she pulls her randomness from /dev/urandom. 🎲
  • -U | --uniquelocalhq β€” like --uniquelocal, except she uses /dev/random on Linux and FreeBSD for that highest-quality random number generation. on other systems this option is just equal to --uniquelocal. heads up though: reading from /dev/random can take a minute ⏳ β€” you can speed it up by feeding in random input, like pressing keys or wiggling the mouse. you know what to do. wiggle 🐭
  • -n | --noreverselookup β€” turns reverse DNS lookup off.
  • -g | --nogeoiplookup β€” turns GeoIP lookup off.
  • -c | --nocolour | --nocolor β€” turns the colourised output off. (spelling both ways, she's inclusive like that πŸ’œ)
  • -h | --help β€” prints the command-line parameters, aka the cheat sheet.
  • -v | --version β€” prints the program version.

πŸ¦‹ EXIT STATUS πŸ¦‹

the subnetcalc tool exits with 0 when things go right, and >0 if there's an error. sad girl hours 😭 when it's not zero.


πŸ”₯ EXAMPLES πŸ”₯

  • subnetcalc -v
  • subnetcalc 132.252.250.0 255.255.255.0
  • subnetcalc 132.252.250.0/255.255.255.0 --nocolor
  • subnetcalc 132.252.250.0 24
  • subnetcalc 132.252.250.0/24 --nocolour
  • subnetcalc fe80::2f0b:a04e:15c2:bc68 64
  • subnetcalc fe80::2f0b:a04e:15c2:bc68%wlp4s0 64
  • subnetcalc fec0:2345:6789:1111:221:6aff:fe0b:2674 56
  • subnetcalc 2a00:1450:8007::69 64
  • subnetcalc ff08::1:2:3
  • subnetcalc 131.220.6.5/24
  • subnetcalc 132.252.181.87 -n
  • subnetcalc www.iem.uni-due.de 24
  • subnetcalc www.six.heise.de
  • subnetcalc fd00:: 64 --uniquelocal
  • subnetcalc fd00::9876:256:7bff:fe1b:3255 56 --uniquelocalhq
  • subnetcalc dΓΌsseldorf.de 28
  • subnetcalc www.kΓΆln.de
  • subnetcalc rΓ€ksmΓΆrgΓ₯s.josefsson.org 24
  • subnetcalc xn--smrgstrta-82ac2r.xn--domne-ira.example 26
  • subnetcalc smΓΆrgΓ₯stΓ₯rta.domΓ€ne.example 255.255.255.240

πŸ“ NOTES πŸ“

the latest version of SubNetCalc is chilling on the SubNetCalc Homepage at SubNetCalc Homepage: https://www.nntb.no/~dreibh/subnetcalc/. go visit, she's iconic πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

Thomas Dreibholz, Homepage: https://www.nntb.no/~dreibh β€” the actual genius behind all of this πŸ’–


and that's the whole vibe, bestie πŸ’… this was subnetcalc(1) from the General Commands Manual, dated May 26, 2026. slay, go calculate something. πŸ¦‹βœ¨πŸŒˆ

πŸ“¦ where this page comes from