openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
160 stars 96 forks source link

stops advertising prefixes #122

Closed brianjmurrell closed 4 years ago

brianjmurrell commented 5 years ago

Per #119, I have created multiple logical interfaces and am using the prefix_filter to advertise my IPv6 prefixes with different priorities:

config dhcp 'lan'
    option interface 'lan'
    option dhcpv6 'disabled'
    option ra 'server'
    option dns 'fd31:aeb1:48df::2'
    option ra_management '0'
    option prefix_filter 'fc00:0:0:0:0:0:0:0/7'
    option ra_preference 'high'

config dhcp 'lan1'
    option interface 'lan1'
    option dhcpv6 'disabled'
    option ra 'server'
    option dns 'fd31:aeb1:48df::2'
    option ra_management '0'
    option prefix_filter '2001:1234::/32'
    option ra_preference 'high'

config dhcp 'lan2'
    option interface 'lan2'
    option dhcpv6 'disabled'
    option ra 'server'
    option dns 'fd31:aeb1:48df::2'
    option ra_management '0'
    option prefix_filter '2001:567:1a:123::/64'
    option ra_preference 'medium'

And this works for a while after starting odhcpd but then at some point it stops advertising some of the prefixes:

Soliciting ff02::2 (ff02::2) on pc_bridge...

Hop limit                 :           64 (      0x40)
Stateful address conf.    :           No
Stateful other conf.      :           No
Mobile home agent         :           No
Router preference         :       medium
Neighbor discovery proxy  :           No
Router lifetime           :         1800 (0x00000708) seconds
Reachable time            :  unspecified (0x00000000)
Retransmit time           :  unspecified (0x00000000)
 Source link-layer address: 6C:B0:CE:F5:1E:4A
 MTU                      :         1500 bytes (valid)
 Prefix                   : 2001:567:1a:123::/64
  On-link                 :          Yes
  Autonomous address conf.:          Yes
  Valid time              :     infinite (0xffffffff)
  Pref. time              :     infinite (0xffffffff)
 Route                    : 2001:567:1a:123::/64
  Route preference        :       medium
  Route lifetime          :     infinite (0xffffffff)
 Recursive DNS server     : fd31:aeb1:48df::2
  DNS server lifetime     :         6000 (0x00001770) seconds
 from fe80::6eb0:ceff:fef5:1e4a

Hop limit                 :           64 (      0x40)
Stateful address conf.    :           No
Stateful other conf.      :           No
Mobile home agent         :           No
Router preference         :         high
Neighbor discovery proxy  :           No
Router lifetime           :            0 (0x00000000) seconds
Reachable time            :  unspecified (0x00000000)
Retransmit time           :  unspecified (0x00000000)
 Source link-layer address: 6C:B0:CE:F5:1E:4A
 MTU                      :         1500 bytes (valid)
 Recursive DNS server     : fd31:aeb1:48df::2
  DNS server lifetime     :         6000 (0x00001770) seconds
 from fe80::6eb0:ceff:fef5:1e4a

Hop limit                 :           64 (      0x40)
Stateful address conf.    :           No
Stateful other conf.      :           No
Mobile home agent         :           No
Router preference         :         high
Neighbor discovery proxy  :           No
Router lifetime           :            0 (0x00000000) seconds
Reachable time            :  unspecified (0x00000000)
Retransmit time           :  unspecified (0x00000000)
 Source link-layer address: 6C:B0:CE:F5:1E:4A
 MTU                      :         1500 bytes (valid)
 Prefix                   : fd31:aeb1:48df::/64
  On-link                 :          Yes
  Autonomous address conf.:          Yes
  Valid time              :     infinite (0xffffffff)
  Pref. time              :     infinite (0xffffffff)
 Route                    : fd31:aeb1:48df::/48
  Route preference        :         high
  Route lifetime          :     infinite (0xffffffff)
 Recursive DNS server     : fd31:aeb1:48df::2
  DNS server lifetime     :         6000 (0x00001770) seconds
 from fe80::6eb0:ceff:fef5:1e4a

As you can see, two of the entries above have no prefix or route information in them. If I simply restart odhcpd all of the entries in the RA will have prefixes and routes.

dedeckeh commented 5 years ago

Can you set odhcpd loglevel to 7 in dhcp config and repeat the test ? Can you attach the output of logread ?

brianjmurrell commented 5 years ago

Can you set odhcpd loglevel to 7 in dhcp config and repeat the test ?

Sure. I'm not sure how long it takes to regress so I will try to keep an eye on it.

Can you attach the output of logread ?

Did you want that after setting loglevel to 7 or at it's current? If the latter: logread.txt

brianjmurrell commented 5 years ago

Hrm. loglevel 7 is going to fill my disk by the time the problem reproduces itself:

Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: A default route is present but there is no public prefix on br-lan thus we don't announce a default route!
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 0 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: A default route is present but there is no public prefix on br-lan thus we don't announce a default route!
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 0 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: A default route is present but there is no public prefix on br-lan thus we don't announce a default route!
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 0 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: A default route is present but there is no public prefix on br-lan thus we don't announce a default route!
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 0 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: A default route is present but there is no public prefix on br-lan thus we don't announce a default route!
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 0 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 1800 seconds on br-lan
Jan 28 09:31:27 gw odhcpd[25145]: A default route is present but there is no public prefix on br-lan thus we don't announce a default route!
Jan 28 09:31:27 gw odhcpd[25145]: Using a RA lifetime of 0 seconds on br-lan
brianjmurrell commented 5 years ago

And, even with loglevel set back to 0, odhcpd is pegging all available CPU on my router.

brianjmurrell commented 5 years ago

Any ideas here? The CPU pegging is most troubling as it cripples the router.

dedeckeh commented 5 years ago

Do you observe this behavior on master or on openwrt-18.06 ?

brianjmurrell commented 5 years ago

On 18.06.

dedeckeh commented 5 years ago

Checking the logread traces it looks like a message storm is created by a device (IPv6 address fe80::21f:c6ff:fec4:926a) which keeps sending RS messages in response to unicast RA messages.

Mon Jan 28 07:17:49 2019 daemon.debug odhcpd[9314]: Received 16 Bytes from fe80::21f:c6ff:fec4:926a%br-lan
Mon Jan 28 07:17:49 2019 daemon.info odhcpd[9314]: Address 2607:1234:5678:abcd::1 (prefix 60, valid 535045) not suitable as RA prefix on br-lan
Mon Jan 28 07:17:49 2019 daemon.info odhcpd[9314]: Address 2001:1234:abcd:a700::1 (prefix 60, valid 539810) not suitable as RA prefix on br-lan
Mon Jan 28 07:17:49 2019 daemon.warn odhcpd[9314]: A default route is present but there is no public prefix on br-lan thus we don't announce a default route!
Mon Jan 28 07:17:49 2019 daemon.info odhcpd[9314]: Using a RA lifetime of 0 seconds on br-lan
Mon Jan 28 07:17:49 2019 daemon.debug odhcpd[9314]: Sent 64 bytes to fe80::21f:c6ff:fec4:926a%br-lan

Any idea which device is continuously sending RS?

brianjmurrell commented 4 years ago

@dedeckeh Apologies. I didn't know this was waiting for a response from me.

The device storming the RSes was NetworkManager on EL7.

References: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/179 https://mail.gnome.org/archives/networkmanager-list/2019-May/msg00004.html

dedeckeh commented 4 years ago

Thx for the update and the references