-
Notifications
You must be signed in to change notification settings - Fork 13
/
ipv6gen.1
169 lines (160 loc) · 2.23 KB
/
ipv6gen.1
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
.TH ipv6gen 1
.SH NAME
ipv6gen \- IPv6 prefix generator.
.SH SYNOPSIS
.B ipv6gen
[
.B \-d
]
[
.B \-lmr
]
[
.B \-s <num>
]
.B
<prefix> <prefix_length>
.SH DESCRIPTION
.PP
\fBipv6gen\fP is tool which generates list of IPv6 prefixes of given
prefix length from certain prefix according to RFC 3531.
.PP
.SH OPTIONS
.TP
.B \-d
debug mode. Displays allocated prefix as bit array.
.TP
.B \-l
allocate bits from the left. e.g. for delta 4, the bit array looks like this:
.nf
0000
1000
0100
1100
0010
1010
0110
1110
0001
1001
0101
1101
0011
1011
0111
1111
.fi
.Ed
.TP
.B \-r
allocate bits from the right. This is the same as allocation from the left
but reversed. e.g. again for delta of value 4:
.nf
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
.fi
.TP
.B \-m
allocate bits from the middle. This method tries to allocate bits close
to the axis of delta first and then proceeds to sides.
For delta of value 4 it is:
.nf
0000
0100
0010
0110
1000
1100
1010
1110
0001
0011
0101
0111
1001
1011
1101
1111
.fi
For delta of value 5, it is:
.nf
00000
00100
01000
01100
00010
00110
01010
01110
\&...
00001
00011
00101
00111
01001
01011
01101
01111
10001
10011
10101
10111
11001
11011
11101
11111
.fi
.TP
.B \-s <num>
set step between generated prefixes. It will leave out step-1 prefixes
between each two generated prefixes. default step value is 1.
.TP
.B \-n <num>
maximum amount of prefixes to generate - only applicable in left and right modes.
.SH EXAMPLES
If we need to to split /48 prefix into two prefixes:
.nf
worm[~/IPv6/ipv6gen]> ./ipv6gen.pl 2001:1508:1003::/48 49
2001:1508:1003:0000::/49
2001:1508:1003:8000::/49
.fi
To allocate bits from the middle from /32 prefix with 4-bits wide delta:
.nf
worm[~/IPv6/ipv6gen]> ./ipv6gen.pl -m 2001:1508::/32 36
2001:1508:0000::/36
2001:1508:4000::/36
2001:1508:2000::/36
2001:1508:6000::/36
2001:1508:8000::/36
2001:1508:C000::/36
2001:1508:A000::/36
2001:1508:E000::/36
2001:1508:1000::/36
2001:1508:3000::/36
2001:1508:5000::/36
2001:1508:7000::/36
2001:1508:9000::/36
2001:1508:B000::/36
2001:1508:D000::/36
2001:1508:F000::/36
.fi
.SH AUTHOR
Vladimir Kotal <[email protected]>
.SH WEBPAGE
http://techie.devnull.cz/ipv6/ipv6gen
.SH BUGS/TODO
ipv6gen should be converted to Perl library/module.