bash - ipv6calc outputs wrong address when converting from ipv4 to ipv6? -
having strange issue while trying convert ipv4 list file ipv6:
ipv6calc -q --action conv6to4 --in ipv4 1.1.23.1 --out ipv6 2002:101:1701::
trying validate result correct, used online converters , seems 1.1.23.1 2002:0:0:0:0:0:101:1701 (or else 2002::101:1701). last "::" should removed & 2002 should have ":".
i don't want use sed/awk commands in order manipulate result, questions are:
- is there alternative cmd/linux sw?
- is somehow fixed inside ipv6 calc, doing wrong?
thanks
this correct 6to4 address. 6to4 subnet on format 2002:ip4_hi:ip4_lo::/48
. ip4_hi
top 16 bits of ipv4 address, while ip4_lo
low 16 bits of address.
for example, ipv4 address 1.2.3.4
gives 6to4 subnet 2002:0102:0304::/48
.
see 6to4 address block allocation more details.
a different question whether address want? there other ways map ipv4 addresses ipv6 addresses. example, there ipv4-mapped ipv6 addresses, typically written ::ffff:1.2.3.4
.
the address format need depends on going use for.
Comments
Post a Comment