[rmax] - April 2005 This little tool takes a list of IPv4 addresses on the command line, and calculates the respective IPv6 address prefixes for the 6to4 network. package require Tcl # calculate the 6to4 prefix for a given IPv4 address proc 6to4 {addr} { set addr [split [string trim $addr] .] if {[llength $addr] != 4} { return -code error \ "\"$addr\" does not consist of 4 octets separated by dots" } foreach octet $addr { if {![string is integer $octet] || $octet < 0 || $octet > 255} { return -code error "\"$octet\" is not a valid octet" } } eval [linsert $addr 0 format "2002:%x%02x:%x%02x::"] } foreach v4 $argv { catch {6to4 $v4} v6 puts "$v4 -> $v6" } ---- [[ [Category Internet] ]]