I just checked out ptrtd. Understanding what it does is actually harder than installing and using it…: ptrtd is useful if you have an IPv6 only network. Of course, you do not want to isolate yourself from the IPv4 internet, so you need a way to access it. ptrtd maps every IPv4 address into IPv6 by prependig a prefix, so the whole internet becomes a tiny speck in the IPv6 address space. An address like 192.168.1.1 becomes fec0:0:0:ffff::192.168.1.1. ptrtd does this by creating a virtual network interface (tap) using tuntap.
But first the installation, which is pretty common:
I tested with:
When it starts, it creates the interface:
tap0 Link encap:Ethernet HWaddr D2:B2:5E:9D:07:89 inet6 addr: fe80::1/64 Scope:Link inet6 addr: fe80::d0b2:5eff:fe9d:789/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:129 errors:0 dropped:0 overruns:0 frame:0 TX packets:115 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:500 RX bytes:18747 (18.3 KiB) TX bytes:15839 (15.4 KiB)
and sets the route to the network fec0:0:0:ffff::/64 to that device:
# ip -6 route show ... fec0:0:0:ffff::/64 via fe80::5 dev tap0 metric ... ...
So now every IPv4 address is reachable via IPv6. I can for example ssh to 192.168.2.1 using the address fec0:0:0:ffff::192.168.1.1. The destination host does not notice, it appears to be coming from a usual IPv4 address.
Of course, the host running ptrtd needs to have both IPv4 and IPv6 (dual stack). It becomes only really interesting for hosts in an IPv6 only network when they set the route to fec0:0:0:ffff::/64 to the host running ptrtd.
The problem left is that we do not want to use the literal IPv6 addresses, but DNS names. And that’s where totd steps in. It translates IPv4 addresses from DNS to IPv6 addresses. I will test that later, and hopefully write about it.