Using the CLI tool ip
I wrote the following script to set up the tunnelbroker.net IPv6 6in4 tunnel on Linux using the ip
command. You have to adjust the constants to the values given on the tunnelbroker.net site on the tunnel that you created. Just execute it and you should be ready to go:
Notes:
- If you don't use the ufw firewall, comment out the line
sudo ufw allow proto ipv6 from $HEIPV4SERVER
as well as the following four lines. - To find out your current local IPv4 on the default interface, replace the line
LOCALIPV4=...
with thisLOCALIPV4=`ip -4 addr show dev $(ip route | grep "default via" | cut -d " " -f 5) | grep inet | awk '{ print $2}' | cut -d "/" -f 1`
- If you want to script an automatic tunnel endpoint update on the HE website (like in the script for Mac OS X) you may want to query your external IPv4 using this:
EXTERNAL_IPV4=`wget -qO- http://v4.ipv6-test.com/api/myip.php`
Using /etc/network/interfaces
Hints found on https://wiki.kubuntu.org/IPv6#Get%20connected%20with%20Hurricane%20Electric and http://davecoyle.com/documents/ubuntu-ipv6-he-tunnel.html.
You can automatically set up the IPv6 tunnel by adding such an entry to your /etc/network/interfaces
:
auto he-ipv6 iface he-ipv6 inet6 v4tunnel endpoint 216.218.226.238 address 2001:470:a:dabc::2 netmask 64 up ip -6 route add default dev he-ipv6 down ip -6 route del default dev he-ipv6
You can also use the following script to add the configuration to /etc/network/interfaces:
Using ifconfig
and route
(deprecated)
- The tunnel setup using "ifconfig" and "route" is deprecated, but here is how you would do it: https://gist.github.com/962287#file_tunnelbroker_net.linux_deprecated.sh
OpenDNS via IPv6
http://test-ipv6.com/faq_v6ns_bad.html
To include an IPv6 DNS server, add the IPv6 OpenDNS servers to your /etc/resolv.conf
:
nameserver 2620:0:ccc::2 nameserver 2620:0:ccd::2
Test your IPv6 connectivity
You may test your success on the site http://test-ipv6.com/.
Resources
- your Ubuntu box as a IPv6 router: https://wiki.kubuntu.org/IPv6#Configure%20your%20Ubuntu%20box%20as%20a%20IPv6%20router
- Example firewall configuration for IPv6: http://www.cyberciti.biz/faq/ip6tables-ipv6-firewall-for-linux/
- Using HE as Tunnelbroker on Linux
- Kubuntu wiki page on IPv6: https://wiki.kubuntu.org/IPv6