Hurricane Electric offers free IPv6 over IPv4 tunnels, but requires the endpoint to be aware of your own IPv4 endpoint in order for the tunnel to operate (which makes perfect sense - it is an IP-based tunnel which has no awareness of connections and needs to know where to forward inbound packets).
If you are on a dynamic IP address (especially one that changes as frequently as mine), this poses a small problem. There are a variety of methods available to you such as Dynamic DNS updaters, adding shell scripting to a field in your router if it is Linux-based, etc. Actually there is no shortage of solutions at all. I chose to implement something using Universal Plug'n'Play for several reasons:
- My router's ability to run DynDNS updating scripts is fairly limited, and quite unreliable.
- I cannot (easily) have a script running that updates both my tunnel broker endpoint and actual DynDNS.
- It seems unnecessary to have to go out to the internet (e.g. one of the many "what is my IP"-style sites) just to figure out your public address.
- I wanted to learn about UPnP.
- There's always time for more Go programming.
- UPnP Device Architecture
- This describes the general structure of the protocol in most detail.
- WAN IP Connection Service
- The actual service that needs to be queried after discovery.
- UPnP Hacks
- Has some practical examples of usage.
- Download and configure Golang (at least 1.2 recommended)
go fmt; go build
./upnp_tunnel_updater \
-user-id=<USERID> \
-password=<PASSWORD> \
-tunnel-id=<TUNNEL_ID>
You can also specify -noop
to find the IP but not update the Tunnelbroker
configuration.
A local cache file will be saved (named by default .upnp_tunnel_updater.cache
)
in the current directory, with the current IP address. This will be checked on
each run to avoid making unnecessary updates to the Tunnelbroker config.
- Subscribing to the event endpoint and remaining resident for continuous updates.
- Code cleanup.