The Valid Lifetime of RA messages of two devices with the same DHCP (v6) configuration is inconsistent

Environment: The two routers have the same hardware model and system version (OpenWrt 21.02.2). The DHCP configuration is the same. They both obtain ipv6-pd through pppoe dialing. The DHCP configuration is as follows (uci show dhcp.lan):

dhcp.lan=dhcp
dhcp.lan.interface='lan'
dhcp.lan.dhcpv4='server'
dhcp.lan.ra='server'
dhcp.lan.ra_flags='none'
dhcp.lan.leasetime='2h'
dhcp.lan.ra_maxinterval='300'
dhcp.lan.ra_mininterval='120'
dhcp.lan.ra_lifetime='3600'
dhcp.lan.ra_useleasetime='1'

Requirement: Modify the value of Valid Lifetime or Preferred Lifetime in the RA message

The LAN device under Router A captures ICMPv6(RA) Valid Lifetime: 7200 is the expected value

     ICMPv6 Option (Prefix information : 2000:3:5587:50::/64)
         Type: Prefix information (3)
         Length: 4 (32 bytes)
         Prefix length: 64
         Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A)
         Valid Lifetime: 7200
         Preferred Lifetime: 43200
         Reserved
         Prefix: 2000:3:5587:50::

The LAN device under Router B captures ICMPv6(RA) Valid Lifetime: 2580, which is not the expected value.

     ICMPv6 Option (Prefix information : 2000:3:5122:200::/64)
         Type: Prefix information (3)
         Length: 4 (32 bytes)
         Prefix length: 64
         Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A)
         Valid Lifetime: 2580
         Preferred Lifetime: 2580
         Reserved
         Prefix: 2000:3:5122:200::

question:

  1. The two routers are almost the same. Why do they have different results? How to troubleshoot the problem?
  2. What configuration file does odhcpd get its parameters from when running, and what configurations will affect this result?

Another discovery:

When the dhcp.lan.ra_lifetime parameter value is not set, the icmpv6.nd.ra.router_lifetime in the RA message is the default value 1800. When the dhcp.lan.ra_lifetime='3600' parameter value is set, the icmpv6.nd.ra.router_lifetime in the RA message is the default value of 3600, and there is no problem with the above. However, after deleting this parameter and value, icmpv6.nd.ra.router_lifetime in the RA message did not return to the default value of 1800 but changed to 900. Even if the system is restarted, it is not restored. So I very much suspect that odhcpd refers to unknown parameters or configuration files. Checking the odhcpd service script does not find that any parameters or configuration files are referenced.

Internet Control Message Protocol v6
    Type: Router Advertisement (134)
    Code: 0
    Checksum: 0xd5be [correct]
    [Checksum Status: Good]
    Cur hop limit: 64
    Flags: 0x40, Other configuration, Prf (Default Router Preference): Medium
    Router lifetime (s): 900
    Reachable time (ms): 0

So how are the odhcpd operation parameters obtained?

The reason was found: Router B obtained the preferred_lft and valid_lft values of IPv6-PD, both of which were less than 2h, so odhcpd chose the minimum value.

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