Hey guys,
Here is basic script that converts ipv4 IPs/subnets to ipv6.
lab example:
[Expert@CP-GW:0]# ./v4to6.sh 10.0.0.0/8
Input: 10.0.0.0/8
IPv4 subnet:
network: 10.0.0.0/8
last: 10.255.255.255
IPv4-mapped IPv6 subnet form (prefix length = 96 + IPv4 mask):
dotted: ::ffff:10.0.0.0/104
hex: ::ffff:a00:0/104 (full: ::ffff:0a00:0000/104)
NAT64 IPv4-embedded IPv6 subnet form (prefix length = 96 + IPv4 mask):
dotted: 64:ff9b::10.0.0.0/104
hex: 64:ff9b::a00:0/104 (full: 64:ff9b::0a00:0000/104)
Range (first/last) in NAT64 form:
first: 64:ff9b::10.0.0.0 (hex: 64:ff9b::0a00:0000)
last: 64:ff9b::10.255.255.255 (hex: 64:ff9b::0aff:ffff)
[Expert@CP-GW:0]# ./v4to6.sh 8.8.8.8
Input: 8.8.8.8
IPv4-mapped IPv6 (RFC4291 ::ffff:0:0/96):
dotted: ::ffff:8.8.8.8
hex: ::ffff:808:808 (full: ::ffff:0808:0808)
NAT64 IPv4-embedded IPv6 (RFC6052 /96 prefix):
dotted: 64:ff9b::8.8.8.8
hex: 64:ff9b::808:808 (full: 64:ff9b::0808:0808)
[Expert@CP-GW:0]#
Best,
Andy