1SIPCALC(1)                  General Commands Manual                 SIPCALC(1)
2
3
4

NAME

6       sipcalc - IP subnet calculator
7

SYNOPSIS

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

DESCRIPTION

12       Sipcalc  is  an  ip subnet calculator consisting of two parts.  A plain
13       text based console version, and web (cgi) based counterpart.  This man‐
14       page  only  addresses the console based version.  Sipcalc, in it's sim‐
15       plest form takes an ip-address and a subnet mask on the commandline and
16       outputs  information  about  the  subnet.  Sipcalc has support for both
17       IPv4 and IPv6 addresses.
18
19       Sipcalc can take input in three forms, an ip-address/netmask, an inter‐
20       face or via stdin using the special character -.
21
22
23       Address-IPv4
24              Address must be given in the "standard" dotted quad format, ie.:
25              xxx.xxx.xxx.xxx and prepended with a netmask the can be given in
26              three different ways:
27               - CIDR, ex. /n where n >= 0 <= 32.
28               - Dotted quad, ex. xxx.xxx.xxx.xxx.
29               - A hex value, ex 0xnnnnnnnn or nnnnnnnn.
30
31
32       Address-IPv6
33              Addresses  may  be given in any of the forms defined in RFC2373,
34              the netmask (prefix) must be given in CIDR notion.  Valid values
35              for  the netmask range from n >= 0 <= 128, default value if net‐
36              mask is omitted is 128.
37
38
39       Interface
40              Instead of taking address information from the commandline  sip‐
41              calc  can  obtain relevant information by looking at a specified
42              interface on the system. Sipcalc then uses this  information  to
43              calculate output values. This option is currently only available
44              for IPv4 addresses, work is being  done  to  support  IPv6  here
45              also.
46
47
48       -      Further  arguments  will  be read from stdin, this can be useful
49              for example for cat(1) ing a list of addresses stored in a  file
50              to  sipcalc.   Each  line  sent  to  sipcalc  should contain one
51              address/netmask or interface.
52
53
54       Any number/combination of Address and Interface arguments can exist  on
55       the  commandline,  however,  the  special character - must be the first
56       argument or it will be parsed as an interface.  All  options  following
57       the - character will be discarded.
58
59       Features (IPv4) -
60
61       *      Multiple address and netmask input formats.
62
63       *      Retrieving of address information from interfaces.
64
65       *      Classfull and CIDR output.
66
67       *      Multiple  address  and netmask output formats (dotted quad, hex,
68              number of bits).
69
70       *      Output of broadcast  address,  network  class,  Cisco  wildcard,
71              hosts/range, network range.
72
73       *      Output of multiple types of bitmaps.
74
75       *      Output of a user-defined number of extra networks.
76
77       *      Multiple networks input from commandline.
78
79       *      DNS resolutions of hostnames.
80
81       *      Parsing  of  a  newline separated list of networks from standard
82              input (STDIN).
83
84       *      The ability to "split" a network based  on  a  smaller  netmask,
85              also with recursive runs on the generated subnets.
86
87
88       Features (IPv6) -
89
90       *      Compressed and expanded input addresses.
91
92       *      Compressed and expanded output.
93
94       *      Standard IPv6 network output.
95
96       *      v4 in v6 output.
97
98       *      Reverse dns address generation.
99
100       *      DNS resolutions of hostnames.
101
102       *      The  ability  to  "split"  a network based on a smaller netmask,
103              also with recursive runs on the generated subnets.
104
105
106       Output.
107
108       Sipcalc output is divided into sections and subsections.  Each  section
109       starts  with  the string "-[type : INPUT] - n" where type can be one of
110       int-ipv4, ipv6, ipv4. INPUT is one input option  from  the  commandline
111       and  n is the number of the section that this input option has produced
112       currently displayed.  Currently the only  input  option  that  produces
113       multiple  output  sections  is  an interface with multiple addresses. A
114       subsection starts with the string "[IDENTIFIER]", where  IDENTIFIER  is
115       an  identifier for the subsection type.  The subsection types are based
116       on the used commandline options.  Sections always en  with  the  single
117       character  '-' alone on a line.  Worth mentioning is also that sections
118       can include not only subsections, but also other  sections,  this  cur‐
119       rently  only  happen  when  the  -u  and -s/-S options are used.  Warn‐
120       ings/errors etc. can also be displayed in the form -[type : message].
121
122       Description of common output:
123
124       [IPv4]
125
126       Host address
127              The given host address.
128
129       Network address
130              The first address in a given range,  unusable  for  hosts  under
131              normal conditions.
132
133       Network mask
134              The  network  mask (netmask) used to specify the size of a given
135              subnet, usually represented in three different  formats:  dotted
136              quad (xxx.xxx.xxx.xxx) hex (0xnnnnnnnn) bits (/n where n >= 0 <=
137              32)
138
139       Broadcast address
140              The broadcast address  of  a  given  subnet,  usually  the  last
141              address in a range.
142
143       Cisco wildcard
144              The  inverted value of the netmask (netmask ^ 0xffffffff).  This
145              value is commonly used in for example access-lists on routers.
146
147       Addresses in network
148              The number of addresses in the given subnet.
149
150       Network range
151              The full subnet range.
152
153       Usable range
154              The range in the given subnet that is commonly used  for  normal
155              hosts.
156
157
158       [IPv6]
159
160       Expanded Address
161              The full expanded IPv6 address.
162
163       Compressed address
164              The IPv6 address compressed in the most efficient way possible.
165
166       Subnet prefix
167              The prefix of the address (in relation to the netmask), the suf‐
168              fix of the address is zeroed out.
169
170       Address ID
171              The suffix of the address (in relation to the netmask), the pre‐
172              fix of the address is zeroed out.
173
174       Prefix address
175              The IPv6 equivalent of the IPv4 netmask.
176
177       Prefix length
178              Number of bits set in the netmask.
179
180       Address type
181              The address type as defined in RFC2373.
182
183       Comment
184              Some addresses will have comments from the author.
185
186       Network range
187              The start and end addresses of the subnet.
188
189       Expanded v4inv6 address
190              The full expanded IPv6 address in v4inv6 format.
191
192       Compr. v4inv6 address
193              The compressed IPv6 address in v4inv6 format.
194
195       Reverse DNS
196              The address in IPv6 reverse DNS form.
197

OPTIONS

199       -a, --all
200              Give  all  possible  information  about an address or interface,
201              this is equivalent to giving the flags -b -c -i -n  0  for  IPv4
202              and -e -r -t for IPv6.
203
204
205       -b, --cidr-bitmap (IPv4)
206              Display CIDR based bitmaps.
207
208
209       -c, --classfull-addr (IPv4)
210              Display classfull address information.
211
212
213       -d, --resolve
214              Enable name resolution.
215
216
217       -e, --v4inv6 (IPv6)
218              Display v4inv6 address information.
219
220
221       -h, --help
222              Display the commandline help.
223
224
225       -i, --cidr-addr (default IPv4)
226              Display CIDR address information.
227
228
229       -I, --addr-int=INT
230              Explicitly add an interface.  This can be used to circumvent the
231              sipcalc "smart parsing" of addresses/interfaces on the  command‐
232              line. This can be useful if you for example for some reason have
233              an interface with the  same  name  as  an  actual  address,  eg.
234              127.0.0.1 or ::1 etc.  See also: -4 -6.
235
236
237       -n, --subnets=NUM
238              Display  NUM  extra  subnets (starting from the current subnet).
239              Will display all subnets in the current /24 if NUM is 0.
240
241
242       -r, --v6rev (IPv6)
243              Display IPv6 reverse DNS information.
244
245
246       -s, --v4split=MASK (IPv4)
247              Split the current network into subnets of MASK size. MASK can be
248              given in dotted quad, hex or CIDR form.
249
250
251       -S, --v6split=MASK (IPv6)
252              Split  the  current network into subnets of MASK size. MASK must
253              be given in CIDR form, either with or with the '/' character.
254
255
256       -t, --v6-standard (default IPv6)
257              Display IPv6 address information.
258
259
260       -u, --split-verbose
261              This will put network splitting into verbose mode.   This  means
262              that  all the subnets generated when splitting a network will be
263              passed back to sipcalc for explicit parsing giving the same out‐
264              put  as  if  the address had been given on the commandline.  All
265              options passed to sipcalc on the commandline will also be inher‐
266              ited when the subnet is passed back to sipcalc for parsing, with
267              one exception, the -s/-S flag, we don't want  an  endless  loop.
268              Sending  only  the  -s/-S  and -u flags to sipcalc will give the
269              default output (-i for ipv4 and -t for ipv6).
270
271
272       -v, --version
273              Display version information.
274
275
276       -w, --wildcard
277              Takes a cisco wildcard (inverse mask)  and  display  the  corre‐
278              sponding regular netmask and netmask bit count.
279
280
281       -x, --classful-bitmap (IPv6)
282              Display a classfull bitmap.
283
284
285       -4, --addr-ipv4=ADDR
286              Explicitly add an IPv4 address.  See also: -I -6.
287
288
289       -6, --addr-ipv6=ADDR
290              Explicitly add an IPv6 address.  See also: -I -4.
291

BUGS

293       Probably  lots.   Known missing features include getting IPv6 addresses
294       from interfaces and implementing the  -n  option  for  IPv6  addresses.
295       Please  send  any  bugs,  feature  requests,  patches, comments etc. to
296       simon@routemeister.net.
297
298

URL

300       Sipcalc can be downloaded from http://www.routemeister.net/
301
302

AUTHOR

304       Simon Ekstrand <simon@routemeister.net>.
305
306
307
308
309                                19 January 2002                     SIPCALC(1)
Impressum