Version 2 of How to auto calculate IPv6

Updated 2014-12-20 07:10:57 by dkf

Hi all, who has available code for auto calculate Ipv6 address. My requirement is generate a new ipv6 which are based on increase by step and IP count.

For example, start IP is 2002::1, step is ::1, count is 10, the result is 2000::10. Many thanks in advance.

DKF: This is really not a great use of the wiki, but it's hard to tell what you want. (IPv6 addresses are in hex.)

for {set i 1} {$i<=16} {incr i} {
    lappend ips [format "2002::%x" $i]
}
puts [join $ips ", "]