Network Configuration in FreeBSD

There are detailed projects for installing a Dual Stack FreeBSD server with both FreeBSD 8.4 and 9.1. These include enabling and configuring IPv6, but that information is included here as well, for those who already have FreeBSD installed. FreeBSD 9.x is a major revision of FreeBSD in many respects. One of the significant changes is in how you configure IPv6. 

Deploy Dual Stack FreeBSD 8.4 Server

Deploy Dual Stack FreeBSD 9.1 Server

There is also a project showing how to enable and configure a DHCPv4 server (dhcpd) and a Router Advertisement Daemon (rtadvd). It also enables packet forwarding for both IPv4 and IPv6:

Create a Virtual Dual Stack Router with FreeBSD 9.1

In the following, it is assumed we are enabling and configuring IPv6 on one interface, which is "em0". Replace "em0" with the name of your interface if different. You can enable IPv6 on any number of interfaces. It is further assumed that the desired node address is 2001:db8:1:1000::21, and the default gateway address is 2001:db8:1:1000::1. Replace these addresses below with your own settings.

Enable IPv6:

Pre 9.x:

ipv6_enable="YES"

9.x:

ipv6_network_interfaces="em0"

ifconfig_em0_ip6="inet6_accept_rtadv"

ip6addrctl_policy="ipv6_prefer"

Specify IPv6 Static Address

Pre 9.x:

ipv6_ifconfig_em0="2001:db8:1:1000::21 prefixlen 64"

9.x:

ifconfig_em0_ipv6 = "inet6 2001:db8:1:1000::21 prefixlen 64"

Specify Default Gateway

All versions (use global unicast or link-local, but not both):

ipv6_defaultrouter="2001:db8:1:1000::1"

ipv6_defaultrouter="fe80::fe80::290:bff:fe1b:5762%em0"

Note: with all versions of FreeBSD, if you specify a static address, the node will not use SLAAC to determine the default gateway or to configure additional global unicast addresses, even if you have specifically told it to receive router advertisements. This is different from Windows behavior. If you specify a static node address, you must also specify the default gateway explicitly as shown above.

If you do not specify a static address, the node will obtain the link-local default gateway and a global unicast address for each advertised subnet prefix, using SLAAC.