How to configure IPv6 on FreeBSD

Say your IPv6 block is:

2607:f2f8:100:999::/64

Your gateway will be the first IP:

2607:f2f8:100:999::1

To configure this block on your interface manually, perform the following:

ifconfig em0 inet6 2607:f2f8:100:999::2 prefixlen 64
route add -inet6 ::/0 2607:f2f8:100:999::1

To make these changes persistent across reboots, add the following to your
/etc/rc.conf.

For FreeBSD 8.3 and earlier:

ipv6_enable="YES"
ipv6_defaultrouter="2607:f2f8:100:999::1"
ipv6_ifconfig_em0="2607:f2f8:100:999::2 prefixlen 64"

For FreeBSD 9.0 and later:

ipv6_activate_all_interfaces="YES"
ipv6_defaultrouter="2607:f2f8:100:999::1"
ifconfig_em0_ipv6="inet6 2607:f2f8:100:999::2 prefixlen 64"

You can run IPv6 alongside your regular IPv4 addresses, you won't lose any
IPv4 connectivity by performing the above steps.