This go project is the combination of some older python scripts that performed the same function, with a few more added features. Web version of this utlity can be found here.
A command-line utility for IPv6 subnet generation and IPv4/IPv6 address translation using RFC 6052. The pre-compiled binary is compiled for Apple silicon.
- IPv6 Subnet Generation
- Generate subnets from an IPv6 prefix.
- Optionally limit output using
-lflag.
- IPv4 ↔ RFC 6052 IPv6 Conversion
- Convert IPv4 to a synthesized IPv6 address (
-s IPv4). - Convert an RFC 6052 IPv6 address back to IPv4.
- Convert IPv4 to a synthesized IPv6 address (
- Custom Prefix Support (
-k)- Allows non-well-known prefixes.
- Decode MAC address from SLAAC address (-m)
- Decode MAC addresses from non-privacy SLAAC addresses
- Decode link local addresses (-a)
- Decode link local address to MAC, and MAC to link local
go build -o ipv6utils ip6utils.go
Usage:
./ipv6utils
-a string
Alias for -local
-c Alias for -count
-count
Display only the number of generated prefixes. (alias: -c)
-k string
Non-well-known prefix for RFC 6052 conversion. (default "64:ff9b::")
-l int
Limit the number of subnets displayed.
-local string
Link-local MAC or IPv6 to convert. (alias: -a)
-m string
SLAAC IPv6 address to decode MAC from.
-n int
Alias for -new-prefix-length (default 40)
-new-prefix-length int
New prefix length for subnet allocation. (alias: -n) (default 40)
-o string
Alias for -output
-output string
File to save the output subnets. (alias: -o)
-p string
Alias for -prefix (default "64:ff9b::")
-prefix string
IPv6 prefix for synthesis. (alias: -p) (default "64:ff9b::")
-s string
Source address for conversion.
./ipv6utils.go -local fe80::0211:22ff:fe33:4455
Output:
MAC from link-local: 00:11:22:33:44:55
./ipv6utils.go -local 00:11:22:33:44:55
Output:
Link-local address: fe80::0211:22ff:fe33:4455
./ipv6utils -s 8.8.8.8
Output:
Converted IPv4 to synthesized IPv6: 64:ff9b::808:808
./ipv6utils -s 64:ff9b::808:808
Output:
Converted synthesized IPv6 to IPv4: 8.8.8.8
./ipv6utils -p 3ffe::0::/32 -n 40 -l 5
Output:
3ffe::/40
3ffe:0:100::/40
3ffe:0:200::/40
3ffe:0:300::/40
3ffe:0:400::/40
./ipv6utils -p 3ffe:0::/32 -n 40 -o subnets.txt
Output:
Subnets saved to subnets.txt
Usage Example for -m:
./ipv6utils -m 3ffe:0::0200:5eff:fe00:5325
Output:
Decoded MAC address: 00:00:5e:00:53:25