FreeBSD IPv6 on CenturyLink

I have a little FreeBSD host on my home network. It’s mostly a plaything, but it does host some backup files and provide a reliable platform for network debugging. I had flailed around trying to get its IPv6 settings to work consistently, so I finally put some real effort into it.

My Internet connection is provided by CenturyLink and is fully IPv6-capable. In the end, I had to do some adjustments on both my cable modem and my FreeBSD machine. Both platforms required reboots during the process, so you’ll need to plan for some short outages to complete this procedure.

CenturyLink has provided me a Zyxel C3000 series cable modem as my home ethernet router. There are some decent instructions you can follow to configure it for IPv6 usage. Here is what I ended up doing.

  • Log into the cable modem.
    1. Click Advanced Setup link.
  • Click the “WAN Settings” link in the navigation menu.
    1. In “Select ISP Protocol” box, set ISP Protocol to Auto Select (which is PPPoE for me).
    2. In “Set the IPv6 addressing values” box, set “6rd state” (sic) to Enable. The remainder of the values auto-populated for me, but here they are for reference:
      • 6rd Prefix: 2602::
      • 6rd Prefix Length: 24
      • IPv4 CE Mask Length: 0
      • IPv4 Border Router Address: 205.171.2.64
    3. In the “Set the WAN IPv6 DNS server” box, set IPv6 DNS Type to Default Servers.
    4. If you have changed any values so far, press the Apply button at the bottom of the page to save your changes.
  • Click the “LAN Subnets” link in the navigation menu.
    1. In the “LAN Subnet List” box, press the Edit IPv6 button.
    2. In the “Set the IPv6 state and addressing” box, set IPv6 Addressing State to Stateless. The values for Network Address (and its mask), ULA Prefix, and Router Advertisement Lifetime all auto-populated for me. You’ll need to check your modem’s IPv6 address values to complete the form if they don’t auto-populate for you.
    3. Press the Replace, Add, or Apply button (any of which may appear, depending on your pre-existing settings and modem model).
  • You’ll probably also want to click the “IPv6 Firewall” link in the navigation menu and choose settings appropriate for you.

Once your modem works with IPv6, many (perhaps most) of the consumer devices connected to your network should soon get IPv6 addresses: iPhones, PCs (Windows, MacOS, Linux), etc. You might see some very slight increases in downloading speeds; I’ve found that IPv6 networks are often less congested than their IPv4 cousins.

FreeBSD changes

Two files needed changes to get FreeBSD setup correctly: rc.conf and sysctl.conf.

The LAN-facing interface on my FreeBSD host is igb0, so you’ll see that referenced below. Your exact configuration will depend on the name of the interface(s) you want to configure for IPv6. At the time I’m writing this document, I’m running FreeBSD 12.1-RELEASE-p8. I suspect things won’t change much during the 12.x releases, but make sure you check the FreeBSD Handbook if you encounter trouble. In my case, the IPv6 section in the Advanced Networking chapter was helpful.

The changes necessary for the /etc/rc.conf file enable IPv6 on the igb0 interface, tell the interface to accept IPv6 router advertisements (part of the Stateless networking enabled above), and start the IPv6 router solicitation daemon.

# /etc/rc.conf
ifconfig_igb0_ipv6="inet6 accept_rtadv"
rtsold_enable="YES"

It’s not strictly necessary to enable the IPv6 temporary address extensions for IPv6 to work, but enabling them is a good idea. Doing so requires adjustment of two kernel parameters via /etc/sysctl.conf.

# /etc/sysctl.conf
# enable the privacy extensions
net.inet6.ip6.use_tempaddr=1
# prefer the privacy addresses
net.inet6.ip6.prefer_tempaddr=1

Once those two files are edited, reboot your host and run ifconfig igb0 (or whatever your interface is named) to verify operations. You will probably have five (5) inet6 addresses assigned per interface:

  1. One will have the prefix fe80::; it’s the link-local address and will end with %igb0 (with your interface name)
  2. Two others will also begin with f; mine are in fd00::. This prefix should match what you saw in the “Set the IPv6 state and addressing” box when you configured your modem. Once of these two addresses will be marked ‘autoconf’, the other ‘autoconf temporary’; the latter is due to enabling the privacy extensions and should change over time.
  3. The final two will probably begin with 2602:: or something very similar. These are the addresses your machine will use to speak to the wider Internet. Again, one will be ‘autoconf,’ the other ‘autoconf temporary.’

Over time you’ll pick up other inet6 addresses that will be marked as ‘deprecated’; those are old temporary addresses that might be still in use for existing connections but won’t be used for new ones.

To test IPv6 connectivity, I like to use the curl utility, e.g.,

curl -6 https://www.madboa.com/

Updates

November 2022: Since I originally posted this article, I’ve upgraded FreeBSD from 12.1 to 13.1. The settings still work as written.

March 2023: RFC 4941 has been obsoleted by RFC 8981.

Freebsd  Howto  Networking