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
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2.
.TH IPADDRCHECK "1" "June 2013" "ipaddrcheck 0.1" "User Commands"
.SH NAME
ipaddrcheck \- an IPv4 and IPv6 validator suitable for use in scripts
.SH SYNOPSIS
.B ipaddrcheck
\fI<OPTIONS> \fR[\fISTRING\fR]
.SH DESCRIPTION
ipaddrcheck is capable of checking various facts about IPv4 and IPv6 addresses,
from checking whether the address is valid to checking whether it is an IPv4
multicast address, host or network address and many more.
.SH OPTIONS
If more than one option is given, they work as logical AND (i.e. if one of them
fails, overall check result is fail). Logical consistency of the options is
left up to the user. The program does not detect whether given options are
compatible, so a mutually exclusive combination like "--is-ipv4 --is-ipv6"
will be accepted and simply return fail for any argument.
.TP
\fB\-\-is\-valid\fR
Check if STRING is a valid IPv4 or IPv6 address
with or without prefix length
.TP
\fB\-\-is\-any\-cidr\fR
Check if STRING is a valid IPv4 or IPv6 address
with prefix length
.TP
\fB\-\-is\-any\-single\fR
Check if STRING is a valid single IPv4 or IPv6 address
.TP
\fB\-\-is\-any\-host\fR
Check if STRING is a valid IPv4 or IPv6 host address
.TP
\fB\-\-is\-any\-net\fR
Check if STRING is a valid IPv4 or IPv6 network address
.TP
\fB\-\-is\-ipv4\fR
Check if STRING is a valid IPv4 address with mask
.TP
\fB\-\-is\-ipv4\-cidr\fR
Check if STRING is a valid CIDR\-formatted address
.TP
\fB\-\-is\-ipv4\-single\fR
Check if STRING is a valid single address
(i.e. with no mask)
.TP
\fB\-\-is\-ipv4\-host\fR
Check if STRING is a host address
.TP
\fB\-\-is\-ipv4\-net\fR
Check if STRING is a network address
.TP
\fB\-\-is\-ipv4\-broadcast\fR
Check if STRING is a broadcast address
.TP
\fB\-\-is\-ipv4\-multicast\fR
Check if STRING is a multicast address
.TP
\fB\-\-is\-ipv4\-loopback\fR
Check if STRING is a loopback address
.TP
\fB\-\-is\-ipv4\-link\-local\fR
Check if STRING is a link\-local address
.TP
\fB\-\-is\-ipv4\-rfc1918\fR
Check if STRING is a private (RFC1918) address
.TP
\fB\-\-is\-ipv6\fR
Check if STRING is a valid IPv6 address
.TP
\fB\-\-is\-ipv6\-cidr\fR
Check if STRING is a CIDR\-formatted IPv6 address
.TP
\fB\-\-is\-ipv6\-single\fR
Check if STRING is an IPv6 address with no mask
.TP
\fB\-\-is\-ipv6\-host\fR
Check if STRING is an IPv6 host address
.TP
\fB\-\-is\-ipv6\-net\fR
Check if STRING is an IPv6 network address
.TP
\fB\-\-is\-ipv6\-multicast\fR
Check if STRING is an IPv6 multicast address
.TP
\fB\-\-is\-ipv6\-link\-local\fR
Check if STRING is an IPv6 link\-local address
.TP
\fB\-\-is\-valid\-intf\-address\fR
Check if STRING is an IPv4 or IPv6 address that
can be assigned to a network interface
.TP
\fB\-\-allow\-loopback\fR
When used with \fB\-\-is\-valid\-intf\-address\fR,
makes IPv4 loopback addresses pass the check
.TP
\fB\-\-version\fR
Print version information and exit
.TP
\fB\-\-help\fR
Print help message and exit
.SS "Exit codes:"
.TP
0
if check passed,
.TP
1
if check failed,
.TP
2
if a problem occured (wrong option, internal error etc.)
.SH EXAMPLES
Check if the argument is a valid IPv4 host address:
ipaddrcheck --is-ipv4-host 192.0.2.78/24
Check if the argument is an address that can be assigned to a loopback interface:
ipaddrcheck --allow-loopback --is-valid-intf-address 127.0.0.7/8
.SH DEFINITIONS
Broadcast address: the last address of an IPv4 subnet.
Interface address: address passes --is-valid-intf-address check if
prefix length is specified, it is not a broadcast address, not a multicast
address, not unspecified address, not from IPv4 THIS network, not a network address
and not the IPv4 limited broadcast address.
.SH AUTHOR
Written by SO3Group.
.SH COPYRIGHT
Copyright \(co SO3Group 2013.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
|