tunnelbroker.net (by Hurricane Electric) offers a free IPv6 tunnel service to encourage IPv6 adoption that you can use on your home network or with your servers. I initially used it for my home network (until my ISP officially supported IPv6 around 2013).

They also provide an excellent free DNS service, which includes “dynamic DNS” support. So if you host stuff at home, or just want to be able to ssh in from an IPv4 network, the DNS service can be updated automatically when your IPv4 address changes.

In short, here is how dynamic DNS with tunnelbroker works:

  • create/edit a “A” DNS record, check the box “Enable entry for dynamic dns” (it may display 127.0.0.1 as your IP, if you are connecting using IPv6, it will get updated when ddclient runs)
  • after adding the new DNS record, a “refresh” icon will appear in the “DDNS” column of the DNS listing
  • click on that icon to generate a new key which will be used as your password.

Debian

We are now ready to configure it on the client (e.g. the home router with the public IPv4 address):

  • install “ddclient” (apt-get install ddclient, on Debian)
  • the remote server is dyn.dns.he.net
  • the username is the subdomain name, ex: my.example.org
  • the password is the key that was generated earlier
  • and enter again the subdomain, as being the DNS record that will be updated

This should be the resulting configuration in /etc/ddclient.conf:

use=web, web=ipify-ipv4
protocol=dyndns2, \
ssl=yes, \
server=dyn.dns.he.net, \
login=my.example.org, \
password='ddns-key-for-the-subdomain', \
my.example.org

To debug, run ddclient --force.

OpenWRT

Install the requirements:

1
2
opkg update
opkg install ddns-scripts wget ca-certificates curl ca-bundle

Then configure in /etc/config/ddns:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
config service "myddns_ipv4"
	option service_name	"he.net"
	option lookup_host	"dyn.example.org"
	option domain		"dyn.example.org"
	option username		"my-he-username"
	option password		"somerandomkey"
	option interface	"wan"
	option ip_source	"network"
	option ip_network	"wan"
	option enabled		"1"

The update_url is not required because he.net is a known service in /usr/share/ddns/default/he.net.json.