# \[Documentation\] RA & DHCPv6

**URL:** <https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708>\
**Category:** Talk about Documentation\
**Created:** [February 12, 2024, 10:17am UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708 "2024-02-12T10:17:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilaro](https://forum.openwrt.org/letter_avatar/gilaro/32/5_5575768a8748004e209b776fc1b2916d.png) [@gilaro](https://forum.openwrt.org/u/gilaro)\
**Post date:** [February 12, 2024, 10:17am UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/1 "2024-02-12T10:17:29Z")

</div>

Hi!

[The IPv6 configuration is really strange.](https://openwrt.org/docs/guide-user/network/ipv6/configuration#router_advertisement_dhcpv6) 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](https://datatracker.ietf.org/doc/html/rfc3736#ref-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](https://datatracker.ietf.org/doc/html/rfc3736)

## SLAAC only

```plaintext
# 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](https://openwrt.org/docs/techref/odhcpd#dhcp_section) → `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

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

```

This is really confusing!

Best regards, gilaro.

---

<div class="post-metadata">

**Author:** ![trendy](https://forum.openwrt.org/user_avatar/forum.openwrt.org/trendy/32/8800_2.png) [@trendy](https://forum.openwrt.org/u/trendy)\
**Post date:** [February 12, 2024, 11:29am UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/2 "2024-02-12T11:29:10Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![gilaro](https://forum.openwrt.org/letter_avatar/gilaro/32/5_5575768a8748004e209b776fc1b2916d.png) [@gilaro](https://forum.openwrt.org/u/gilaro)\
**Post date:** [February 12, 2024, 1:33pm UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/3 "2024-02-12T13:33:33Z")

</div>

**Note:** Damn, I have read the wrong RFC. [The right one is RFC 8415](https://datatracker.ietf.org/doc/html/rfc8415).

---

<div class="post-metadata">

**Author:** ![trendy](https://forum.openwrt.org/user_avatar/forum.openwrt.org/trendy/32/8800_2.png) [@trendy](https://forum.openwrt.org/u/trendy)\
**Post date:** [February 12, 2024, 6:04pm UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/4 "2024-02-12T18:04:30Z")

</div>

If your problem is solved, please consider marking this topic as [Solved]. See [How to mark a topic as [Solved]](https://forum.openwrt.org/t/how-to-mark-a-topic-as-solved/40174) for a short how-to.  
Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![gilaro](https://forum.openwrt.org/letter_avatar/gilaro/32/5_5575768a8748004e209b776fc1b2916d.png) [@gilaro](https://forum.openwrt.org/u/gilaro)\
**Post date:** [February 13, 2024, 8:28am UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/5 "2024-02-13T08:28:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gilaro](https://forum.openwrt.org/letter_avatar/gilaro/32/5_5575768a8748004e209b776fc1b2916d.png) [@gilaro](https://forum.openwrt.org/u/gilaro)\
**Post date:** [February 18, 2024, 9:17am UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/6 "2024-02-18T09:17:30Z")

</div>

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](https://openwrt.org/docs/techref/odhcpd#dhcp_section)) 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.

---

<div class="post-metadata">

**Author:** ![flygarn12](https://forum.openwrt.org/user_avatar/forum.openwrt.org/flygarn12/32/57396_2.png) [@flygarn12](https://forum.openwrt.org/u/flygarn12)\
**Post date:** [February 18, 2024, 10:48am UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/7 "2024-02-18T10:48:54Z")

</div>

> [@gilaro](#):
>
> So strictly speaking, it's incorrect to name this section "dhcp". This name is confusing.

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.

---

<div class="post-metadata">

**Author:** ![gilaro](https://forum.openwrt.org/letter_avatar/gilaro/32/5_5575768a8748004e209b776fc1b2916d.png) [@gilaro](https://forum.openwrt.org/u/gilaro)\
**Post date:** [February 18, 2024, 12:03pm UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/8 "2024-02-18T12:03:41Z")

</div>

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](https://openwrt.org/docs/guide-user/network/ipv6/configuration#native_ipv6_connection)] && [[2](https://openwrt.org/docs/guide-user/base-system/dhcp)]).

There is also a documentation page about an unknown package `wide-dhcpv6-client` (c.f. [[3](https://openwrt.org/docs/guide-user/network/ipv6/dhcp6c)]).

---

<div class="post-metadata">

**Author:** ![flygarn12](https://forum.openwrt.org/user_avatar/forum.openwrt.org/flygarn12/32/57396_2.png) [@flygarn12](https://forum.openwrt.org/u/flygarn12)\
**Post date:** [February 18, 2024, 1:36pm UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/9 "2024-02-18T13:36:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![trendy](https://forum.openwrt.org/user_avatar/forum.openwrt.org/trendy/32/8800_2.png) [@trendy](https://forum.openwrt.org/u/trendy)\
**Post date:** [February 18, 2024, 4:16pm UTC](https://forum.openwrt.org/t/documentation-ra-dhcpv6/187708/10 "2024-02-18T16:16:53Z")

</div>

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