Using ptrtd

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:

./configure
make

I tested with:

sudo ./ptrtd

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.

Advertisements

2 Comments

Filed under debian, ipv6, linux

2 responses to “Using ptrtd

  1. Kert

    You wrote:
    > 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.

    I can’t seem to get this to work…
    Do you have an example of setting up a route to the machine running ptrtd?
    I have tried:
    ip route add fec0:0:0:ffff::/64 dev eth1 via
    I get ‘unreachable’ errors…
    Thanks

  2. Kert

    The latest version is archived at:
    http://code.google.com/p/ptrtd/