[SOLVED] How to automatically configure IPv6 (stateful DHCPv6)

Aaron LI aly at aaronly.me
Tue Aug 29 01:28:48 PDT 2017


Hello DFlyers,


I have figured out the IPv6 configuration problem, here are the details,
and hope it can help others.


IPv6 Autoconfiguration
----------------------
Briefly, there are two kinds of IPv6 autoconfiguration method [1,2]:

* stateless:
  No DHCP to assign addresses.  IPv6 addresses are built by using
autoconfiguration and by having routers announce the IP addresses of
machines in the network.  In this case, "rtsol" tool is needed to
_solicitate_ that information from routers.

* stateful:
  DHCP is used to assign addresses.  An IPv6-compatible "dhclient" is
needed, no autoconfiguration occurs, and "rtsol" is not needed.


My Network
----------
My network uses the second "stateful" DHCPv6 method.


DragonFly BSD
-------------
The "dhclient" shipped in the base system does NOT support IPv6, so my
previous trials failed to obtain IPv6 address.  (FreeBSD also has the
same problem.)

Consulting to this post [3], an additional IPv6-compatible DHCP client
is required to get IPv6 address.  The post's author has made the
"net/dual-dhclient" port to help the settings.

1. Install "net/dual-dhclient" package:
# pkg install dual-dhclient

2. Add these lines to "/etc/rc.conf":
dhclient_program="/usr/local/sbin/dual-dhclient"
ipv6_enable="YES"
ipv6_network_interfaces="em0"
ipv6_ifconfig_em0="DHCP"

3. Restart the network service:
# service netif restart

DONE!


For example, my current interface status looks like:

dfly> ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
	inet6 fe80::21d:9ff:fe88:acd3%em0 prefixlen 64 scopeid 0x1 
	inet 192.168.1.235 netmask 0xffffff00 broadcast 192.168.1.255
	inet6 2001:da8:8000:6440::be76 prefixlen 64 
	ether 00:1d:09:88:ac:d3
	media: Ethernet autoselect <rxpause> (100baseTX <full-duplex,rxpause>)
	status: active

(Besides the base "/sbin/dhclient" process for the IPv4 DHCP, there will
be another "/usr/local/sbin/dhclient -6" process for the IPv6 DHCP.)


[1] DHCPv6 - dhclient: https://forums.freebsd.org/threads/6098/#post-36953
[2] IPv6 Network (auto) configuration: https://egustafson.github.io/ipv6-dhcpv6.html
[3] IPv6 on FreeBSD/EC2: http://www.daemonology.net/blog/2017-01-26-IPv6-on-FreeBSD-EC2.html


Cheers,
-- 
Aly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20170829/44d03266/attachment.bin>


More information about the Users mailing list