-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME
125 lines (88 loc) · 3.6 KB
/
README
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
Overview
========
Some simple tools for working with IPv6 addresses.
ipv6-arpa - Given an IPv6 address, display it in ip6.arpa format. e.g
$ ./ipv6-arpa 2001:db8:1:2::f00f
Address : 2001:0db8:0001:0002:0000:0000:0000:f00f
ip6.arpa :-
f.0.0.f.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.1.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
ipv6-isin - Given an IPv6 network/prefix and an IPv6 address, determine
if the address falls within the given network. e.g
$ ./ipv6-isin 2001:db8:1:2::/64 2001:db8:1:2::cafe
Yes
$ ./ipv6-isin 2001:db8:1:2::/64 2001:db8:1:20::cafe
No
ipv6-range - Given a network address and prefix, calculate the range
of available IPs. e.g
$ ./ipv6-range 2001:db8:1:2::/64
Network : 2001:db8:1:2::/64
Start : 2001:0db8:0001:0002:0000:0000:0000:0000
End : 2001:0db8:0001:0002:ffff:ffff:ffff:ffff
A /64 provides 18,446,744,073,709,551,616 addresses
gen-ula - Generates an IPv6 ULA prefix based on the algorithm in
RFC 4193. e.g
$ ./gen-ula
fd0c:d0e3:46f0::/48
/64 subnet range:
fd0c:d0e3:46f0:0000::/64 -
fd0c:d0e3:46f0:ffff::/64
The gen-ula tool requires libuuid and mhash.
mac-to-eui64 - Generates a modified EUI-64 identifier for the given MAC
address.
$ ./mac-to-eui64 00:21:2f:b5:6e:10
Modified EUI-64 :-
02:21:2f:ff:fe:b5:6e:10
(SLAAC Host) ::0221:2fff:feb5:6e10
The mac address can also be read from stdin e.g
$ ./ipv6-extract-mac fe80::6231:97ff:fe1a:de8b | ./mac-to-eui64
Modified EUI-64 :-
62:31:97:ff:fe:1a:de:8b
(SLAAC Host) ::6231:97ff:fe1a:de8b
mac-type - Test the U/L (Universal/Local) and IG (Individual/Group) bits
of a MAC address.
$ ./mac-type 00:21:2f:b5:6e:10
U/L (LG) bit is NOT set. Address is universally administered.
IG bit is NOT set. Unicast address.
$ ./mac-type df:ad:be:ef:ca:fe
U/L (LG) bit is set. Address is locally administered.
IG bit is set. Broadcast address.
The mac address can also be read from stdin e.g
$ ./ipv6-extract-mac fe80::6231:97ff:fe1a:de8b | ./mac-type
U/L (LG) bit is NOT set. Address is universally administered.
IG bit is NOT set. Unicast address.
ipv6-extract-mac - Given an IPv6 address such as one generated through
SLAAC. This will attempt to extract the MAC address
from it.
./ipv6-extract-mac 2001:db8::200:5eff:fe00:5300
00:00:5e:00:53:00
prefix-to-mask - Given an IPv6 prefix length, display the compressed
and uncompressed network mask representations.
$ ./prefix-to-mask 10
comp ffc0::
uncomp ffc0:0000:0000:0000:0000:0000:0000:0000
mask-to-prefix - Given an IPv6 network mask display the prefix length.
$ ./mask-to-prefix ffc0::
prefixlen : 10
ipv6-fmt - Given an IPv6 address format it in compressed,
expanded and URI literal forms.
$ ./ipv6-fmt 2001:0db8:0000::dead:0000:beef
Compressed : 2001:db8::dead:0:beef
Expanded : 2001:0db8:0000:0000:0000:dead:0000:beef
URI Literal : [2001:db8::dead:0:beef]
ipv6-gen-slaac - Given an IPv6 network & MAC address, generate the
corresponding SLAAC address.
$ ./ipv6-gen-slaac 2001:db8:a:b:: 00:24:1d:ba:80:00
SLAAC : 2001:db8:a:b:224:1dff:feba:8000
ipv4mapped-ipv6 - Given an IPv4 address produce an IPv4-mapped IPv6
address.
$ ./ipv4mapped-ipv6 192.168.1.254
IPv4-mapped IPv6 : ::ffff:192.168.1.254
: ::ffff:c0a8:01fe
Build
=====
$ make
gen-ula requires libuuid-devel & mhash-devel
License
=======
These tools are licensed under the GNU General Public License Version 2 or
the GNU Lesser General Public License Version 2.1