Skip to content

Instantly share code, notes, and snippets.

@antonlindstrom
Created February 18, 2011 10:24
Show Gist options
  • Save antonlindstrom/833506 to your computer and use it in GitHub Desktop.
Save antonlindstrom/833506 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
#http://www.pps.jussieu.fr/~jch/software/ipv6-connectivity.html
set -e
ip4=$1
echo "$ip4" | grep -q '^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*$' || \
{ echo 'Syntax: $0 a.b.c.d'; exit 1; }
prefix=$(printf '%02x%02x:%02x%02x\n' $(echo $ip4 | sed 's/\./ /g'))
ip tunnel add 6to4 mode sit remote any local $ip4
ip link set dev 6to4 up
ip addr add 2002:$prefix::1/16 dev 6to4
ip -6 route add ::/0 via ::192.88.99.1 dev 6to4 metric 1026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment