Mark Dalby

Fighting Ignorance since 1986 (It’s taking longer than I thought).

Advertisement

Archive for the ‘ networking ’ Category

1) Sign up for an account at tunnelbroker.com (also known as HE)

2) Using the tunnel broker website create a new tunnel and make a note of the settings it assigns you.

3)create a file with the following as its contents….

#!/bin/bash
#######################################################################
# Update the HE (Hurricane Electric) ipv6-tunnel
#######################################################################
# Interface to use: en1 = Airport, en0 = Ethernet
MYIF=”en1″
# leave as is
IPCACHE=”/Library/Caches/ipv6scriptIP”
HEUSER=3da0676a512baf3294f7eb923f115bea
HEPASS=1eb2c32ab1c2616725fadab3554e0c5b
HETUNNEL=81743
HETUNEND=216.66.80.26
HEYOUR6END=2001:470:1f08:1062::2
HETHEIR6END=2001:470:1f08:1062::1
HEPREFIX=64
HEMY64IP=2001:470:1f08:1062::3
#######################################################################
# Config end
#######################################################################
# sometimes this script will get executed twice at the same time, not good, so:
if [ -f $IPCACHE.lock ] ; then
echo A copy already running!
exit 0
else
touch $IPCACHE.lock
fi
# This is faster if your router sets a dyndns entry:
#NEW_IP=`dig mycomp.myvnc.com|grep “^mycomp”| grep -Eo “\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>”`
NEW_IP=`curl -s “http://www.networksecuritytoolkit.org/nst/cgi-bin/ip.cgi”`
# Wait for the network…
while [ ! -n "$NEW_IP" ]
do
sleep 10
#NEW_IP=`dig mycomp.myvnc.com|grep “^mycomp”| grep -Eo “\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>”`
NEW_IP=`curl -s “http://www.networksecuritytoolkit.org/nst/cgi-bin/ip.cgi”`
done
OLD_IP=`cat $IPCACHE`
if [ "$NEW_IP" = "$OLD_IP" ] ; then
CURCONF=`ifconfig |grep $HETUNEND`
if [ -n "$CURCONF" ] ; then
echo Nothing to do
rm $IPCACHE.lock
exit 0
fi
fi
echo -n $NEW_IP > $IPCACHE
# if you need to use your public ip address, use LOCAL_IP=$NEW_IP instead
LOCAL_IP=`ifconfig $MYIF |grep -E ‘inet.[0-9]‘ | grep -v ’127.0.0.1′ | awk ‘{ print $2}’`
# let’s delete a pre-existing gif0, ignore any errors
ifconfig gif0 deletetunnel
ifconfig gif0 down
ifconfig gif0 inet6 delete $HEYOUR6END
ifconfig gif0 inet6 delete $HEMY64IP
route delete -inet6 default -interface gif0
# update the tunnel
curl -k -s “https://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=$NEW_IP&pass=$HEPASS&user_id=$HEUSER&tunnel_id=$HETUNNEL”
echo ” “
sleep 1
ifconfig gif0 tunnel $LOCAL_IP $HETUNEND
ifconfig gif0 inet6 $HEMY64IP/64 alias
ifconfig gif0 inet6 $HEYOUR6END $HETHEIR6END prefixlen /$HEPREFIX
route -n add -inet6 default $HETHEIR6END
rm $IPCACHE.lock
exit 0
4) Fill in these details in the above script…
HEUSER= Your userhash from the top of the tunnelbroker login page.
HEPASS=  type echo <Your HE password>|md5 to get this value.
HETUNNEL= The tunnel Id assigned to you from tunnelbroker.
HETUNEND=The IPV4 server address supplied by tunnelbroker.
HEYOUR6END=Your IPV6 address as assigned by tunnelbroker.
HETHEIR6END=tunnelbroker’s IPV6 address.
HEPREFIX= this is always 64 unless your doing some advanced configuration which is beyond the scope of this post.
5) chmod the script +x
6) type ./<scriptname> to create your tunnel, If all has gone well you should be able to see ipv6.google.com
7) Enjoy.
Full Credit goes to http://pugio.net/2009/01/enable-ipv6-on-mac-os-x-the-tu.html for the creation of the above script, His tutorial is much better than mine, I’ve just tried to make it a little shorter for the more ‘tech savvy’ and inpatient among us.
Enhanced by Zemanta