File: addr6.1

package info (click to toggle)
ipv6toolkit 2.0%2Bds.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,296 kB
  • sloc: ansic: 26,827; perl: 1,058; makefile: 137
file content (336 lines) | stat: -rw-r--r-- 10,428 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
.TH ADDR6 1
.SH NAME
addr6 \- An IPv6 address analysis and manipulation tool
.SH SYNOPSIS
.B addr6
.RB [\| \-a
.IR IPV6_ADDR\| \ \-i]
.RB [\| \-d \|]
.RB [\| \-d \|]
.RB [\| \-q \|]
.RB [\| \-s \|]
.RB [\| \-j
.IR PREFIX \|]
.RB [\| \-b
.IR TYPE \|]
.RB [\| \-k
.IR SCOPE \|]
.RB [\| \-w
.IR UNICAST_TYPE \|]
.RB [\| \-g
.IR IID_TYPE \|]
.RB [\| \-J
.IR PREFIX \|]
.RB [\| \-B
.IR TYPE \|]
.RB [\| \-K
.IR SCOPE \|]
.RB [\| \-W
.IR UNICAST_TYPE \|]
.RB [\| \-G
.IR IID_TYPE \|]
.RB [\| \-v \|]
.RB [\| \-h \|]


.SH DESCRIPTION
.B addr6
is an IPv6 address analysis tool tool. It can employed identify the address type/scope, and infer the type of Interface ID employed by an IPv6 address. Additionally, 
.B addr6
can also produce statistics about a set of IPv6 addresses.

.B addr6
can filter lists of IPv6 addresses based on a number of criteria (address type, address scope, prefixes, duplicate addresses, etc.). There are two types of filters: "block filters" and "accept filters". If any "block filter" is specified, and IPv6 addresses matching any of those filters will be discarded. If any "accept filter" is specified, any IPv6 address matching that filter will be accepted (and printed on stdout).

.SH OPTIONS
.B addr6
takes its parameters as command-line options. Each of the options can be specified with a short name (one character preceded with the hyphen character, as e.g. "\-i") or with a long name (a string preceded with two hyphen characters, as e.g. "\-\-stdin").


.TP
.BI \-a\  IPV6_ADDRESS ,\ \-\-address\  IPV6_ADDRESS

This option ca be employed to specify a single IPv6 address that is meant to be processed by the tool. This option is typically employed in conjunction with the '\-d' tool, to decode the IPv6 address in question.

.TP
.BR \-i ,\  \-\-stdin

This option request the tool to read IPv6 addresses from standard input (stdin), until an EOF (End-Of-File) condition is found.



.TP
.BI \-j\  PREFIX ,\ \-\-accept\  PREFIX

Accept IPv6 addresses belonging to the specified IPv6 prefix (PREFIX/LEN).


.TP
.BI \-b\  TYPE ,\ \-\-accept\-type\  TYPE

Accept IPv6 addresses belonging to the specified address type. Valid address types are:

  * unicast
  * unspec
  * multicast


.TP
.BI \-k\  SCOPE ,\ \-\-accept\-scope\  SCOPE

Accept IPv6 addresses belonging to the specified address scope. Valid address scopes are:

  * reserved
  * interface (or "interface-local)
  * link (or "link-local")
  * admin (or "admin-local")
  * site (or "site-local")
  * admin (or "admin-local")
  * organization (or "organization-local")
  * global
  * unassigned
  * unspecified

.TP
.BI \-w\  UNICAST_TYPE ,\ \-\-accept\-utype\  UNICAST_TYPE

Accept IPv6 addresses belonging to the specified unicast type. Valid unicast address types are:

  * loopback
  * ipv4-compat
  * ipv4-mapped
  * link-local
  * site-local
  * unique-local
  * 6to4
  * teredo
  * global


.TP
.BI \-g\  IID_TYPE ,\ \-\-accept\-iid\  IID_TYPE

Accept unicast IPv6 addresses with an Interface ID of the specified type. Valid Interface ID types are:

  * ieee
  * isatap
  * ipv4-32
  * ipv4-64
  * ipv4-all
  * embed-port
  * embed-port-rev
  * embed-port-all
  * low-byte
  * byte-pattern
  * random


.TP
.BI \-J\  PREFIX ,\ \-\-block\  PREFIX

Block IPv6 addresses belonging to the specified IPv6 prefix (PREFIX/LEN).


.TP
.BI \-B\  TYPE ,\ \-\-block\-type\  TYPE

Block IPv6 addresses belonging to the specified address type. Valid address types are:

  * unicast
  * unspec
  * multicast


.TP
.BI \-K\  SCOPE ,\ \-\-block\-scope\  SCOPE

Block IPv6 addresses belonging to the specified address scope. Valid address scopes are:

  * reserved
  * interface (or "interface-local)
  * link (or "link-local")
  * admin (or "admin-local")
  * site (or "site-local")
  * admin (or "admin-local")
  * organization (or "organization-local")
  * global
  * unassigned
  * unspecified


.TP
.BI \-W\  UNICAST_TYPE ,\ \-\-block\-utype\  UNICAST_TYPE

Block IPv6 addresses belonging to the specified unicast type. Valid unicast address types are:

  * loopback
  * ipv4-compat
  * ipv4-mapped
  * link-local
  * site-local
  * unique-local
  * 6to4
  * teredo
  * global


.TP
.BI \-G\  IPV6_ADDRESS ,\ \-\-block\-iid\  IID_TYPE

Block unicast IPv6 addresses with an Interface ID of the specified type. Valid Interface ID types are:

  * ieee
  * isatap
  * ipv4-32
  * ipv4-64
  * ipv4-all
  * embed-port
  * embed-port-rev
  * embed-port-all
  * low-byte
  * byte-pattern
  * random


.TP
.BR \-q ,\  \-\-print\-unique

This option causes the tool to eliminate duplicate addresses from the list of IPv6 addresses read from standard input (stdin). That is, when reading a list of addresses from stdin, only the first "copy" of each address will be processed by the tool (with later ones being simply ignored).

.TP
.BR \-c ,\  \-\-print\-canonic

This option request the tool to print the IPv6 address specfied with the '\-a' option (or a list of addresses read froom stdin if the '\-i' option was set) in its canonic form. This is useful to before comparing textual representations of IPv6 addresses, since the same address can usually be written in multiple different ways.

.TP
.BR \-d ,\  \-\-print\-decode

This option request the tool to decode the IPv6 address specfied with the '\-a' option (or a list of addresses read froom stdin if the '\-i' option was set). The current version of the tool supports only decode type, in which information is printed for each address with the following syntax:

        AddressType=AddressSubtype=Scope=IIDType=IIDSubtype

This simple syntax is meant to be easy for scripting purposes. Future versions of the tool will incorporate a human-friendly mode.

.TP
.BR \-s\|  ,\  \-\-print\-stats

This option requests the tool to produce address statistics from the list of IPv6 addresses read from standard input. This option should be used in conjunction with the '\-i' option, such that multiple addresses can be given as input to addr6.

addr6 will always print the total number of IPv6 addresses that have been examined, and the percentage of unicast, multicast, and unspecified (::) addresses. If at least one unicast address is identified, unicast-specific statistics will be printed. In the same way, if at least one multicast address is identified, then multicast-specific statistics will be printed.

Unicast-specific statistics include:

  1) Number and percentage of each unicast address type (global
     unicast, link-local unicast, 6to4, Teredo, etc.).

  2) Number and percentage of each of the different Interface
     ID types (IEEE-based, low-byte, etc.).

Only those unicast address types for which there are multiple possible types of Interface-IDs will be considered for the Interface-ID assessment. Namely,

  * 6to4
  * Global Unicast
  * Link-local Unicast
  * Site-local unicast addresses (deprecated)
  * Unique local unicast addresses

Unicast address types such as 'Teredo' are not considered by this analysis, since they have a single type of Interface-ID, as specified by the corresponding specifications.

Multicast-specific statistics include:

  1) Number of addresses and percentage of each multicast
     address type (Permanent, Embedded-RP, etc).
  
  2) Number addresses and percentage of each of the multicast
     address scope different Interface ID types (Link, Interfa-
     ce, Global, etc.)

.TP
.BR \-v\| ,\  \-\-verbose 

This option selects the "verbosity" of the tool. If this option is left unspecified, only minimum information is printed. 

.TP
.BR \-h\| ,\  \-\-help

Print help information for the 
.B addr6
tool. 

.SH EXAMPLES

The following sections illustrate typical use cases of the
.B addr6
tool.

\fBExample #1\fR

$ cat addresslist.txt | addr6 \-i \-q

addr6 will read IPv6 addresses from stdin ('\-i' option), and will only print the first instance of each address ('\-q' option), thus effectively removing any duplicates from the list.

    Note: In this particular scenario, the address list results
    from the command 'cat addresslist.txt', that has its output
    redirected to the standard input of the addr6 tool.


\fBExample #2\fR

$ addr6 \-a fc00::1

Decode the IPv6 address specified with the '\-a' option. Note that while the '\-d' option was not set, this is the default behavior of the tool (unless overridden y another option).


\fBExample #3\fR

$ cat addresslist.txt | addr6 \-i \-q \-s

addr6 will read IPv6 addresses from stdin ('\-i' option), will ignore duplicate addresses ('\-q' option), and will print statistics about the processed IPv6 addresses.

    Note: In this particular scenario, the address list results
    from the command 'cat addresslist.txt', that has its output
    redirected to the standard input of the addr6 tool.


\fBExample #4\fR

$ cat addresslist.txt | addr6 \-i \-q \-d

addr6 will read IPv6 addresses from stdin ('\-i' option), will ignore duplicate addresses ('\-q' option), and will decode each of the remaining addresses.

    Note: In this particular scenario, the address list results
    from the command 'cat addresslist.txt', that has its output
    redirected to the standard input of the addr6 tool.


\fBExample #5\fR

$ cat addresslist.txt | addr6 \-i \-j 2001:db8::/16

addr6 will read IPv6 addresses from stdin ('\-i' option), will discard any addresses that do not belong to the prefix 2001:db8::/16 (i.e., it will "accept" addresses belonging to such prefix).

    Note: In this particular scenario, the address list results
    from the command 'cat addresslist.txt', that has its output
    redirected to the standard input of the addr6 tool.


.SH SEE ALSO
.BR ipv6toolkit.conf (5)

draft-ietf-opsec-ipv6\-host-scanning (available at: 
.IR <http://tools.ietf.org/html/draft\-ietf\-opsec\-ipv6\-host\-scanning> )
for a discussion of different IPv6 address patterns.

.SH AUTHOR
The
.B addr6
tool and the corresponding manual pages were produced by Fernando Gont 
.I <fgont@si6networks.com>
for SI6 Networks 
.IR <http://www.si6networks.com> .

.SH COPYRIGHT
Copyright (c) 2011\-2013 Fernando Gont.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front\-Cover Texts, and no Back\-Cover Texts.  A copy of the license is available at
.IR <http://www.gnu.org/licenses/fdl.html> .