SIPCALC(1)

๐ŸŽ€ SIPCALC ๐ŸŽ€

okay bestie, welcome to sipcalc(1) โ€” the General Commands Manual entry for your new favorite IP subnet calculator. yes, it's a real one, and yes it eats. let's go ๐Ÿ’…


โœจ NAME โœจ

sipcalc โ€” IP subnet calculator ๐Ÿงฎโœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

sipcalc [ -abcdehiInrsStuvx46 ] <[ADDRESS] [INTERFACE] ... | [ - ]>

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

sipcalc is an IP subnet calculator, and it comes in two flavors: a plain text console version, and a web (cgi) counterpart. this manpage is only about the console one, so don't come for me about the cgi thing ๐Ÿซถ

At its most basic, sipcalc takes an ip-address and a subnet mask on the commandline and outputs info about the subnet. And it's bilingual in the best way โ€” it supports both IPv4 and IPv6 addresses. no cap โœจ

sipcalc can take input in three forms:

  • an ip-address/netmask
  • an interface
  • or via stdin using the special character -

๐Ÿ’– Address-IPv4 ๐Ÿ’–

The address has to be in the "standard" dotted quad format, like: xxx.xxx.xxx.xxx, with an optional netmask that you can give in three different ways:

  • CIDR, ex. /n where n >= 0 <= 32.
  • Dotted quad, ex. xxx.xxx.xxx.xxx.
  • A hex value, ex 0xnnnnnnnn or nnnnnnnn.

๐Ÿ’œ Address-IPv6 ๐Ÿ’œ

Addresses can be given in any of the forms defined in RFC2373</c>, and the netmask (prefix) must be given in CIDR notation. Valid values for the netmask range from n >= 0 <= 128, and the default value if the netmask is omitted is 128. ๐ŸŽ€


๐ŸŒˆ Interface ๐ŸŒˆ

Instead of pulling address info off the commandline, sipcalc can go snoop at a specified interface on the system and grab the relevant info from there. Then it uses that to calculate the output values. this option is currently only available for IPv4 addresses โ€” work is being done to support IPv6 here also. patience, bestie ๐Ÿ™ˆ


๐Ÿ“ - ๐Ÿ“

Any further arguments will be read from stdin, which is super useful for stuff like cat(1)-ing a list of addresses stored in a file straight into sipcalc. Each line you send to sipcalc should contain one address/netmask or interface. ๐Ÿ’ซ


Any number/combination of Address and Interface arguments can exist on the commandline, however, the special character - must be the first argument or it will get parsed as an interface. And all options following the - character will be discarded. ๐Ÿ˜ญ


๐Ÿ”ฅ Features (IPv4) ๐Ÿ”ฅ

  • Multiple address and netmask input formats.
  • Retrieving of address information from interfaces.
  • Classfull and CIDR output.
  • Multiple address and netmask output formats (dotted quad, hex, number of bits).
  • Output of broadcast address, network class, Cisco wildcard, hosts/range, network range.
  • Output of multiple types of bitmaps.
  • Output of a user-defined number of extra networks.
  • Multiple networks input from commandline.
  • DNS resolutions of hostnames.
  • Parsing of a newline separated list of networks from standard input (STDIN).
  • The ability to "split" a network based on a smaller netmask, also with recursive runs on the generated subnets.

๐Ÿ’™ Features (IPv6) ๐Ÿ’™

  • Compressed and expanded input addresses.
  • Compressed and expanded output.
  • Standard IPv6 network output.
  • v4 in v6 output.
  • Reverse DNS address generation.
  • DNS resolutions of hostnames.
  • The ability to "split" a network based on a smaller netmask, also with recursive runs on the generated subnets.

โœจ Output โœจ

sipcalc output is divided into sections and subsections, bestie. Each section starts with the string -[type : INPUT] - n where type can be one of int-ipv4, ipv6, ipv4. INPUT is one input option from the commandline, and n is the number of the section that this input option has produced currently displayed. currently the only input option that produces multiple output sections is an interface with multiple addresses. ๐Ÿซถ

A subsection starts with the string [IDENTIFIER], where IDENTIFIER is an identifier for the subsection type. The subsection types are based on the used commandline options. Sections always end with the single character - alone on a line. ๐Ÿ’…

Worth mentioning is also that sections can include not only subsections, but also other sections โ€” this currently only happens when the -u and -s/-S options are used.

Warnings/errors etc. can also be displayed in the form -[type : message].


๐Ÿ’ซ Description of common output ๐Ÿ’ซ

[IPv4] โญ

  • Host address โ€” The given host address.
  • Network address โ€” The first address in a given range, unusable for hosts under normal conditions.
  • Network mask โ€” The network mask (netmask) used to specify the size of a given subnet, usually represented in three different formats: dotted quad (xxx.xxx.xxx.xxx), hex (0xnnnnnnnn), and bits (/n where n >= 0 <= 32)
  • Broadcast address โ€” The broadcast address of a given subnet, usually the last address in a range.
  • Cisco wildcard โ€” The inverted value of the netmask (netmask ^ 0xffffffff). This value is commonly used in for example access-lists on routers.
  • Addresses in network โ€” The number of addresses in the given subnet.
  • Network range โ€” The full subnet range.
  • Usable range โ€” The range in the given subnet that is commonly used for normal hosts.

[IPv6] ๐ŸŒˆ

  • Expanded Address โ€” The full expanded IPv6 address.
  • Compressed address โ€” The IPv6 address compressed in the most efficient way possible.
  • Subnet prefix โ€” The prefix of the address (in relation to the netmask), the suffix of the address is zeroed out.
  • Address ID โ€” The suffix of the address (in relation to the netmask), the prefix of the address is zeroed out.
  • Prefix address โ€” The IPv6 equivalent of the IPv4 netmask.
  • Prefix length โ€” Number of bits set in the netmask.
  • Address type โ€” The address type as defined in RFC2373.
  • Comment โ€” Some addresses will have comments from the author.
  • Network range โ€” The start and end addresses of the subnet.
  • Expanded v4inv6 address โ€” The full expanded IPv6 address in v4inv6 format.
  • Compr. v4inv6 address โ€” The compressed IPv6 address in v4inv6 format.
  • Reverse DNS โ€” The address in IPv6 reverse DNS form.

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -a, --all โ€” Give all possible information about an address or interface, this is equivalent to giving the flags -b -c -i -n 0 for IPv4 and -e -r -t for IPv6. the whole menu, no notes ๐Ÿ”ฅ
  • -b, --cidr-bitmap (IPv4) โ€” Display CIDR based bitmaps.
  • -c, --classfull-addr (IPv4) โ€” Display classfull address information.
  • -d, --resolve โ€” Enable name resolution.
  • -e, --v4inv6 (IPv6) โ€” Display v4inv6 address information.
  • -h, --help โ€” Display the commandline help.
  • -i, --cidr-addr (default IPv4) โ€” Display CIDR address information.
  • -I, --addr-int=INT โ€” Explicitly add an interface. This can be used to circumvent the sipcalc "smart parsing" of addresses/interfaces on the commandline. This can be useful if you for example for some reason have an interface with the same name as an actual address, eg. 127.0.0.1 or ::1 etc. See also: -4 -6.
  • -n, --subnets=NUM โ€” Display NUM extra subnets (starting from the current subnet). Will display all subnets in the current /24 if NUM is 0.
  • -r, --v6rev (IPv6) โ€” Display IPv6 reverse DNS information.
  • -s, --v4split=MASK (IPv4) โ€” Split the current network into subnets of MASK size. MASK can be given in dotted quad, hex or CIDR form.
  • -S, --v6split=MASK (IPv6) โ€” Split the current network into subnets of MASK size. MASK must be given in CIDR form, either with or with the / character.
  • -t, --v6-standard (default IPv6) โ€” Display IPv6 address information.
  • -u, --split-verbose โ€” This will put network splitting into verbose mode. This means that all the subnets generated when splitting a network will be passed back to sipcalc for explicit parsing, giving the same output as if the address had been given on the commandline. All options passed to sipcalc on the commandline will also be inherited when the subnet is passed back to sipcalc for parsing, with one exception, the -s/-S flag โ€” we don't want an endless loop ๐Ÿ˜ญ. Sending only the -s/-S and -u flags to sipcalc will give the default output (-i for IPv4 and -t for IPv6).
  • -v, --version โ€” Display version information.
  • -w, --wildcard โ€” Takes a cisco wildcard (inverse mask) and display the corresponding regular netmask and netmask bit count.
  • -x, --classful-bitmap (IPv6) โ€” Display a classfull bitmap.
  • -4, --addr-ipv4=ADDR โ€” Explicitly add an IPv4 address. See also: -I -6.
  • -6, --addr-ipv6=ADDR โ€” Explicitly add an IPv6 address. See also: -I -4.

๐Ÿ’€ BUGS ๐Ÿ’€

Probably lots. ngl, known missing features include getting IPv6 addresses from interfaces and implementing the -n option for IPv6 addresses. ๐Ÿ˜ญ

Please send any bugs, feature requests, patches, comments etc. to simon@routemeister.net. ๐Ÿ“ฌ


๐Ÿ”— URL ๐Ÿ”—

sipcalc can be downloaded from http://www.routemeister.net/ โœจ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Simon Ekstrand <simon@routemeister.net>. iconic behavior, honestly ๐Ÿ’–


sipcalc(1) โ€” this page is from the General Commands Manual, and it's dated 19 January 2002. old but still slaying, periodt ๐ŸŽ€โœจ bye bestie, go calculate some subnets ๐Ÿ’…๐Ÿฆ‹