IPv6 via 6rd on FreeBSD

Wed 04 February 2015 by feld

My ISP is Charter and they support 6rd for IPv6. Unfortunately 6rd support does not exist in the stf(4) driver in FreeBSD yet. There is a work-in-progress implementation available from hrs in ports, net/stf-6rd-kmod. However, I haven't found very good documentation on exactly how to use it so at the suggestion of nathanw I have impelemented 6rd via a regular gif(4) tunnel.

The configuration in rc.conf looks like below. Just replace the variables with the real IP addresses for your environment:

  cloned_interfaces="gif0"
  ipv6_activate_all_interfaces="YES"
  ifconfig_gif0="tunnel $MYIPv4 $THEIRIPv4"
  ifconfig_gif0_ipv6="inet6 alias $MYIPv6 $THEIRIPv6 prefixlen 128"
  ipv6_defaultrouter="$THEIRIPv6 -mtu 1280"

There is one main limitation because it's using a gif(4) tunnel and not speaking the complete 6rd RFC: you can't contact other IPv6 addresses that are also using this 6rd service.

If you don't care about the capability to contact other users on your ISP also using the 6rd tunnel you will not notice any problems.

Note: I'm setting the default route to an MTU of 1280 because of the behavior of IPv6 tunnels and common issues with PMTU. I suggest you do the same for an optimal experience.