Simple IPV4 to IPV6 address converter
September 7th, 2009
No comments
A dirty 2 shell lines trick to convert a static IPV4 address in the corresponding IPV6:
ipv4=$( ip ad sh eth0 | grep "inet " | awk '{print $2}'| sed -e 's/\/.*//')
printf "2002:%02x%02x:%02x%02x::1" `echo $ipv4 | tr "." " "`
((enjoy))
