Souji Thenria

FreeBSD IPv6 setup

Summary: Getting IPv6 working on FreeBSD is no magic either…

Created on:

-----

The following general information as well as the temporary setup is the same as for the OpenBSD one.

First things first: Figure out what the IPv6 subnet is assigned to you by your provider or hoster. For demonstration purposes, I’ll use 2001:DB8::/32, you probably got a /64 subnet, but it makes no difference for the setup. Just REMEMBER: change the IP address to the one you got assigned.

Next, you need to decide on an IP address to use. I’ll use 2001:DB8::5/32 as my server IPv6 address. After that, you need to identify what the address for your default gateway is. It will almost always be fe80::1; However, check with your provider or hoster.

Btw. if you use PF firewall, you most likely need to allow ICMPv6 in order to use IPv6:
pass proto ipv6-icmp from any to any

Temporary setup

To test the IPv6 setup, you can assign the IP address manually to the interface and add the route.

  1. Set the IP address on the vtnet0 interface ifconfig vtnet0 inet6 2001:DB8::5/32
  2. Add the default route route add -net ::/0 fe80::1%vtnet0

Permanent setup

To make the changes permanent, you need to edit the /etc/rc.conf file (rc.conf(5)). Using the configuration below the primary IP as well as the default route can be specified:

ifconfig_vtnet0_ipv6="inet6 2001:DB8::5/32"
ipv6_defaultrouter="fe80::1%vtnet0"

Furthermore, additional IPv6 addresses for a interface can be specified with:
ifconfig_vtnet0_alias0="inet6 2001:DB8::10 prefixlen 32"

Tags: