Dhcpv6 mode detection: relay or server


I have few questions about dhcpv6 in openwrt.

  1. I understood that relay mode is used only if the ISP gives just a /64 without prefix delegation. Is this condition enough to decide if the relay mode should be enabled? (otherwise use the server mode).

  2. I didn't find information about the hybrid mode regarding how it picks relay vs server. Looking at the source code for odhcpd (https://github.com/openwrt/odhcpd/blob/master/src/config.c) I understand that an interface in hybrid mode is set to

  • relay - if the master interface is in relay mode.
  • server - if the master interface is NOT relay mode or there is no master
    Is this the correct and complete behaviour for the hybrid mode?
    Is the master set to relay mode if and only if there is no received prefix?

My final goal is to detect when to choose server or relay if the ISP is changed (from a script that runs on a router).

Not sure I have your answer. Are you able to get a /64 (or bigger) from your ISP? If so, use 'server-mode' which is the default.

Hello! Happy New Year!

I am not always able to get that, so I want to know when to enable relay mode and when to enable server mode.

The second question wants to know what does the hybrid mode (how it chooses the relay/server mode).

Hopefully you have got things working by now. Sorry about the slow reply. If you are getting PD (Prefix Delegation) from your ISP, then you always want to use "Server Mode".

Here's some documentation:

1 Like

New URL: https://openwrt.org/docs/techref/odhcpd

The old page is for archival purposes only and does not receive updates any more.

1 Like

I also found this solution.

Thanks to both for the help!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.