|Specify the address family which affects interpretation of the remaining parameters. Since subcalc can handle subnet calculations in different protocols with different naming schemes, specifying the address family is recommended. The address or protocol families currently supported are "inet" and "inet6".|
the address is
an Internet address expressed in the Internet standard
It is also possible to use the CIDR notation (also known as the slash notation) to include the netmask. That is, one can specify an address like 192.168.0.1/16.
For "inet6" family, it is also possible to specify the prefix length using the slash notation, like ::1/128. See the prefixlen parameter below for more information.
|Generate an ARPA6 PTR record which the popular DNS server BIND will understand. In order for the components of the PTR record to be complete, a hostname must be specified as well.|
|Specify the number of nodes or addresses on a network and subcalc will calculate an appropriate network subdivision and bits. This is used for netmask discovery. NOTE: currently subcalc calculates the subdivision for one network. In some cases it may be more efficient to use more then one network subdivision.|
|Generate an INT6 PTR record which the popular DNS server BIND will understand. In order for the components of the PTR record to be complete, a hostname must be specified as well.|
Specify how much of the address to reserve for subdividing
networks into sub-networks.
The mask includes the network part of the local address
and the subnet part, which is taken from the host field of the address.
The mask can be specified as a single hexadecimal number
with a leading
or with a dot-notation Internet address.
The mask contains 1s for the bit positions in the 32-bit address
which are to be used for the network and subnet parts,
and 0s for the host part.
The mask should contain at least the standard network portion,
and the subnet field should be contiguous with the network
The netmask can also be specified in CIDR notation after the address. See the address option above for more information.
bits are reserved for subdividing networks into sub-networks.
must be an integer, and for syntactical reason it must be between 0 to 128.
It is almost always 64 under the current IPv6 assignment rule.
If the parameter is omitted, 64 is used.
The prefix can also be specified using the slash notation after the address. See the address option above for more information
|causes each address in the specified network to be printed to stdout, one address per line. Regular subnet calculation is still performed, however each line of the standard calculation output is prefixed by a ; character. This makes it easy for standard subnet calculations to be filtered out, in the event that network lists need to be generated.|
|stf||If the address family is inet, translate the argument as an IPv4 address which will be converted into the arbitrary IPv6 /48 (6to4 rfc3056) network designation. If the family is inet6, translate the argument as an IPv6 network or address specification which will be converted into its arbitrary IPv4 parent address.|
To calculate the network range, number of hosts, prefixlen or CIDR and netmask for the 10.0.0.1/24 (255.255.255.0) network.
Anyone of the following will achieve the exact same thing:
To generate a list of nodes for the specified network one could use anyone of the following methods:
Arbitrarily, the same thing can be done for IPv6. To calculate the network range, number of hosts, prefixlen etc for the 3ffe:beef:13e1:4c92::cd90/48 network, one could use any of the following:
Likewise for printing each node of a network:
IP version 4 PTR records (records which map an address to a canonical name) contain a portion which has a reversed version of the IP octet prefixing the in-addr.arpa. zone. For example, an RFC 1035 PTR record for 10.0.0.1 would look like:
The first section of this PTR record is called the owner:
For IP version 6, rather then reversing each octet, PTR records require that each nibble or 4 bit address subdivision be reversed. For example, the owner section of a PTR record for the IPv6 address 3ffe:beef:13e1:4c92::cd90 would be:
Creating PTR record for IP version 6 addresses can be tedious and more prone to error. subcalc has the capability to automatically subdivide the IPv6 address into nibbles and reverse them into a PTR record like format. An example on how this might be achieved is:
If you wanted to calculate a subdivision for a network given the number of nodes or hosts, you could do:
The next highest network subdivision in this case would be a /27 which has 32 hosts. The netmask for this network would be: 255.255.255.224.
Given an IPv4 address, figure out the 6to4 IPv6 /48 network associated with it.
Given an IPv6 network or address, figure out what IPv4 address represents the parent for the network.
The subcalc utility and this man page was written by Christian S.J. Peron. Send any bugs or patches to (email@example.com).