[Documentation] RA & DHCPv6

Hi!

The IPv6 configuration is really strange. It mixes SLAAC and stateless DHCPv6. You can have automatic autoconfiguration with SLAAC but without DHCPv6. Similarly, you can assign static addresses (no SLAAC) and obtain other configuration parameters with stateless DHCP. Clearly, SLAAC and DHCPv6 are two different things. Nevertheless, it's clear that to set SLAAC in the OpenWrt configuration, we need to specify this in the DHCPv6 section.

Nodes that have obtained IPv6 addresses through some other mechanism, such as stateless address autoconfiguration [6] or manual configuration, can use stateless DHCP to obtain other configuration information such as a list of DNS recursive name servers or SIP servers. β€” RFC 3736: Stateless Dynamic Host Configuration Protocol (DHCP) Service for IPv6

SLAAC only

# cat /etc/config/dhcp
config dhcp lan
    option dhcpv6 disabled
    option ra server
    list ra_flags 'none'
    ...

It would have been more logical to say that you could use stateless DHCPv6 β†’ option dhcpv6 disabled. But this would also activate SLAAC β†’ option ra server (stateless DHCPv6) to obtain IPv6 addresses.

What does the ra_slaac option?

Announce SLAAC for a prefix (that is, set the A flag in RA messages).

See Also

config interface lan
        option proto static
        option ip6assign 60
        ...

This is really confusing!

Best regards, gilaro.

1 Like

Router Advertisement packet is one thing, which is independent of SLAAC or stateful or stateless DHCPv6. It advertises the router to the network. (option ra server)
If A-flag is enabled and there is a prefix in the RA, then you have SLAAC. (ra_slaac option)
If M-flag is enabled you advertise the stateful DHCPv6. (option ra_flags managed-config)
If O-flag is enabled you advertise the stateless DHCPv6. (option ra_flags other-config)

2 Likes

Note: Damn, I have read the wrong RFC. The right one is RFC 8415.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks! :slight_smile:

The problem is not solved. I need to read RFC 8415 first. That way, I'd be able to think more clearly; to avoid confusing things. Your first reply was very helpful, thanks!

I'll post again soon to let people know what's going on.

Hi!

I was completely wrong. I thought the "dhcp" section in the UCI configuration file /etc/config/dhcp referred exclusively to the DHCPv6 configuration.

In fact, odhcpd is a daemon that handles SLAAC, NDP and DHCPv6 (as mentioned in the documentation) protocols.

So strictly speaking, it's incorrect to name this section "dhcp". This name is confusing.

One might also ask why the file name is not odhcpd or something like that.

I agree, the dhcp config is actually a 3-in-1 config.
dnsmasq
odhcpd
odhcpc6
all have that config file together.

I guess it is because of an old compromise before ipv6 really became something, but I don’t really know why they all have one common config file.

Thanks!

It may be worthwhile to know that odhcp6c is managed in the UCI configuration file named /etc/config/network (as seen in the documentation [1] && [2]).

There is also a documentation page about an unknown package wide-dhcpv6-client (c.f. [3]).

Ip address are also defined by network config but run by dnsmasq and odhcp.

Not every package has its own config file.
For example system is taking care of ntpc, ntps, timezones, syslog, and random number generator.

1 Like