dhcpcd icon indicating copy to clipboard operation
dhcpcd copied to clipboard

IPv6 PD route deleted after carrier lost and re-acquired

Open mhoran opened this issue 3 years ago • 5 comments

I noticed that when carrier is lost and re-acquired on my OpenBSD router's LAN interface, which receives its IPv6 subnet from my ISP via prefix delegation, after some time the route to the LAN subnet is deleted. See logs below:

Jan 12 19:52:32 brooklyn dhcpcd[42141]: em1: carrier lost
Jan 12 19:52:32 brooklyn dhcpcd[42141]: em1: deleting address 2600:...:d201::1/64
Jan 12 19:52:32 brooklyn dhcpcd[42141]: em1: deleting route to 2600:...:d201::/64
Jan 12 19:52:39 brooklyn dhcpcd[42141]: em1: carrier acquired
Jan 12 19:52:39 brooklyn dhcpcd[42141]: em1: IAID b9:41:d8:75
Jan 12 19:52:39 brooklyn dhcpcd[42141]: em1: adding delegated prefixes
Jan 12 19:52:39 brooklyn dhcpcd[42141]: em1: adding address 2600:...:d201::1/64
Jan 12 19:52:39 brooklyn dhcpcd[42141]: em1: adding route to 2600:...:d201::/64
Jan 12 19:54:51 brooklyn dhcpcd[42141]: em1: deleting route to 2600:...:d201::/64

The deleting route doesn't seem to correspond to any event. I don't see anything in the logs aside from that line, even when running in debug mode. The interface remains up, and if I restart dhcpcd it runs fine, until I power cycle my switch and then it breaks again.

My dhcpcd.conf is as follows:

option rapid_commit

allowinterfaces em0 em1
ipv6only

nohook resolv.conf

noipv6rs
interface em0
    ipv6rs
    ia_pd 0/::/56 em1/1/64

I've tried the latest code from the master branch and the issue persists.

mhoran avatar Jan 13 '23 01:01 mhoran

Is the time difference between carrier loss/aquisition and the route being deleted roughly the same each time? dhcpcd is deleting the route as it thinks it no longer manages it ....

I suspect this will be OpenBSD specific issue and I'll need to setup my VM to replicate this which might take a while. What version of OpenBSD are you running?

rsmarples avatar Jan 13 '23 17:01 rsmarples

Is the time difference between carrier loss/aquisition and the route being deleted roughly the same each time? dhcpcd is deleting the route as it thinks it no longer manages it ....

It seems to be somewhat random. Last night I saw 2 minutes and then 7 minutes, during testing.

I suspect this will be OpenBSD specific issue and I'll need to setup my VM to replicate this which might take a while. What version of OpenBSD are you running?

7.2

I just added the following to dhcpcd.conf which seems to have helped (it's been 10 minutes and the route is still there):

interface em1
    nolink

I also noticed the following in my logs:

Jan 13 12:43:57 brooklyn dhcpcd[29165]: route socket overflowed (rcvbuflen 8192) - learning interface state
Jan 13 12:43:57 brooklyn dhcpcd[29165]: drained 1 messages

Note sure if it's related, and I did see this once as well without nolink.

mhoran avatar Jan 13 '23 17:01 mhoran

I suspect this will be OpenBSD specific issue and I'll need to setup my VM to replicate this which might take a while. What version of OpenBSD are you running?

I see the same thing on Linux. The default IPv6 route routinely gets deleted and added again.

perkelix avatar Jan 30 '23 11:01 perkelix

Just tracked down this issue to this PR. I am seeing the same on OpenBSD 7.3 and I have the exact same logs as @mhoran.

isadon avatar Jun 20 '23 22:06 isadon

I'm seeing the same on OpenBSD 7.5 when link is lost, for example when I reboot my switch. Similar logs to @mhoran:

Jun  1 05:02:24 gibson dhcpcd[9015]: vlan1: carrier lost
Jun  1 05:02:24 gibson dhcpcd[9015]: vlan1: deleting address 2a01:x:x:x::1/64
Jun  1 05:02:24 gibson dhcpcd[9015]: vlan1: deleting route to 2a01:x:x:x::/64
Jun  1 05:02:24 gibson dhcpcd[9015]: route socket overflowed (rcvbuflen 8192) - learning interface state
Jun  1 05:02:24 gibson dhcpcd[9015]: drained 1 messages
Jun  1 05:03:21 gibson dhcpcd[9015]: vlan1: carrier acquired
Jun  1 05:03:21 gibson dhcpcd[9015]: vlan1: IAID ff:00:00:01
Jun  1 05:03:21 gibson dhcpcd[9015]: vlan1: adding delegated prefixes
Jun  1 05:03:21 gibson dhcpcd[9015]: vlan1: adding address 2a01:x:x:x::1/64
Jun  1 05:03:21 gibson dhcpcd[9015]: vlan1: adding route to 2a01:x:x:x::/64
Jun  1 05:04:09 gibson dhcpcd[9015]: vlan1: deleting route to 2a01:x:x:x::/64

Other machines on vlan1 have broken IPv6 until I restart dhcpcd.

mpolden avatar Jun 04 '24 19:06 mpolden

I think this issue may be the same as issue #333? Commit 4908d93 was made recently to address issue #333, and I think it might have solved this issue too.

I'm running OpenBSD 7.5-current. For dhcpcd, I'm running the code as of 4908d93. For clarity, that's after the 10.0.8 release of dhcpcd, since 10.0.8 doesn't include commit 4908d93.

While this issue was still occurring for me in the 10.0.8 release, it appears fixed for me as of 4908d93. Is my experience, with this issue seeming to be fixed in the master branch of dhcpcd, consistent with what other OpenBSD users are seeing?

VogtRyan avatar Jul 10 '24 16:07 VogtRyan

I've decommissioned the machine where I was having these issues so unfortunately I can't provide any feedback. However, it does sound like this is resolved, so I'll close this issue out.

mhoran avatar Jul 10 '24 16:07 mhoran