IPv4 & IPv6 Client Addresses via DHCP

FreeBSD's builtin DHCP client (dhclient) supports acquiring IPv6 routes and SLAAC addresses only. It does not support acquiring a DHCPv6 assigned IA_NA address, as it is not officially part of the IPv6 standards.

This article details how to configure and run the net/dhcpcd port to acquire both an IPv4 and an IPv6 address via DHCP servers.

 

Install net/dhcpcd using your preferred method.

 

By default, dhcpcd will acquire an IPv4 address lease via DHCP, solicit for an IPv6 router, and generate a SLAAC private IPv6 address.

To configure dhcpcd to also request a DHCPv6 IA_NA address, edit /usr/local/etc/dhcpcd.conf

hostname
ia_na 1

 

Test it by executing dhcpcd:
dhcpcd

 

Edit /etc/rc.conf to enable and trigger dhcpcd at boot time.

dhclient_program="/usr/local/sbin/dhcpcd"
ifconfig_em0="DHCP"