On 2021-11-03 11:41 -06, Zack Newman <z...@philomathiclife.com> wrote: > dhcpleased(8) is unable to renew DHCP leases from my ISP, > Xfinity/Comcast. This in turn is causing leases to expire leading to > IPv4 drops that last between 15 and 20 seconds until a new lease can be > binded. Note that lease binding does succeed. > > For about a month before the release of OpenBSD 7.0, I had been using > dhcpleased(8) instead of dhclient(8) on OpenBSD 6.9 as I wanted to be > "ahead of the curve" before the eventual release of OpenBSD 7.0. During > that time, there were no problems with lease renewals. I have not made > any hardware or software changes other than the upgrade to 7.0. > > I've factory reset my bridge modem about a dozen times, I've changed the > MAC address of the interface connected to the modem, I've experimented > using different NICs altogether, and nothing has worked. At the time, I > "knew" it was Xfinity; so I demanded that a tech come over and inspect > the cable lines and modem. They said it was fine; although based on > Internet reviews, that doesn't say much as they are often wrong. It > wasn't until I had a slice of humble pie and actually considered that > the problem was indeed my router that I was able to fix the problem by > switching to dhcpcd which I have been already using for DHCPv6. Sure > enough, I have had no issues with IPv4 renewals since then. > > I do know that Xfinity, at least where I am, does NOT respond to unicast > renewals for both DHCP and DHCPv6, but I am unsure if that is relevant. > Before I successfully switched to dhcpcd, I made sure to log > dhcpleased(8) over night. Here are the results: > > router# cat /root/dhcp.log > sending output to nohup.out > changed iface: em0[1] > state_transition[em0] Down -> Init, timo: 1 > DHCPDISCOVER on em0 > parse_dhcp, from: 00:01:5c:63:ee:46, to: 1c:1b:0d:e7:08:5c > parse_dhcp: 73.78.230.1:67 -> 73.78.230.64:68 > dhcp_hdr op: Boot Reply (2) > dhcp_hdr htype: Ethernet (1) > dhcp_hdr hlen: 6 > dhcp_hdr hops: 1 > dhcp_hdr xid: 0x9d477ad1 > dhcp_hdr secs: 0 > dhcp_hdr flags: 0x0 > dhcp_hdr ciaddr: 0.0.0.0 > dhcp_hdr yiaddr: 73.78.230.64 > dhcp_hdr siaddr: 0.0.0.0 > dhcp_hdr giaddr: 96.120.12.153 > dhcp_hdr chaddr: 1c:1b:0d:e7:08:5c (00000000000000000000) > DHO_DHCP_MESSAGE_TYPE: DHCPOFFER > DHO_DHCP_SERVER_IDENTIFIER: 96.113.84.152 > DHO_DHCP_LEASE_TIME 4701s > DHO_SUBNET_MASK: 255.255.254.0 > DHO_ROUTER: 73.78.230.1 > DHO_DOMAIN_NAME_SERVERS: 75.75.75.75 (1/2) > DHO_DOMAIN_NAME_SERVERS: 75.75.76.76 (2/2) > DHO_DOMAIN_NAME: hsd1.co.comcast.net. > DHO_28, len: 4 > DHO_DHCP_RENEWAL_TIME 2350s > DHO_DHCP_REBINDING_TIME 4113s > DHO_HOST_NAME: router > DHO_END > DHCPOFFER on em0 from 00:01:5c:63:ee:46/73.78.230.1 to > 1c:1b:0d:e7:08:5c/73.78.230.64 > state_transition[em0] Init -> Requesting, timo: 1 > DHCPREQUEST on em0 > parse_dhcp, from: 00:01:5c:63:ee:46, to: 1c:1b:0d:e7:08:5c > parse_dhcp: 73.78.230.1:67 -> 73.78.230.64:68 > dhcp_hdr op: Boot Reply (2) > dhcp_hdr htype: Ethernet (1) > dhcp_hdr hlen: 6 > dhcp_hdr hops: 1 > dhcp_hdr xid: 0x55ccb8cb > dhcp_hdr secs: 0 > dhcp_hdr flags: 0x0 > dhcp_hdr ciaddr: 0.0.0.0 > dhcp_hdr yiaddr: 73.78.230.64 > dhcp_hdr siaddr: 0.0.0.0 > dhcp_hdr giaddr: 96.120.12.153 > dhcp_hdr chaddr: 1c:1b:0d:e7:08:5c (00000000000000000000) > DHO_DHCP_MESSAGE_TYPE: DHCPACK > DHO_DHCP_SERVER_IDENTIFIER: 96.113.84.152 > DHO_DHCP_LEASE_TIME 4701s > DHO_SUBNET_MASK: 255.255.254.0 > DHO_ROUTER: 73.78.230.1 > DHO_DOMAIN_NAME_SERVERS: 75.75.75.75 (1/2) > DHO_DOMAIN_NAME_SERVERS: 75.75.76.76 (2/2) > DHO_DOMAIN_NAME: hsd1.co.comcast.net. > DHO_28, len: 4 > DHO_DHCP_RENEWAL_TIME 1101s > DHO_DHCP_REBINDING_TIME 3801s > DHO_HOST_NAME: router > DHO_END > DHCPACK on em0 from 00:01:5c:63:ee:46/73.78.230.1 to > 1c:1b:0d:e7:08:5c/73.78.230.64 > adding 73.78.230.64 to em0 (lease from 96.113.84.152) > state_transition[em0] Requesting -> Bound, timo: 1101 > configure_interface em0 > iface_timeout[1]: Bound > state_transition[em0] Bound -> Renewing, timo: 1350 > DHCPREQUEST on em0 > iface_timeout[1]: Renewing > iface_timeout: res.tv_sec: 2452, rebinding_time: 3801 > state_transition[em0] Renewing -> Renewing, timo: 675 > DHCPREQUEST on em0 > iface_timeout[1]: Renewing > iface_timeout: res.tv_sec: 3128, rebinding_time: 3801 > state_transition[em0] Renewing -> Renewing, timo: 337 > DHCPREQUEST on em0 > iface_timeout[1]: Renewing > iface_timeout: res.tv_sec: 3465, rebinding_time: 3801 > state_transition[em0] Renewing -> Renewing, timo: 168 > DHCPREQUEST on em0 > iface_timeout[1]: Renewing > iface_timeout: res.tv_sec: 3634, rebinding_time: 3801 > state_transition[em0] Renewing -> Renewing, timo: 84 > DHCPREQUEST on em0 > iface_timeout[1]: Renewing > iface_timeout: res.tv_sec: 3719, rebinding_time: 3801 > state_transition[em0] Renewing -> Renewing, timo: 60 > DHCPREQUEST on em0 > iface_timeout[1]: Renewing > iface_timeout: res.tv_sec: 3780, rebinding_time: 3801 > state_transition[em0] Renewing -> Renewing, timo: 60
as you point out your ISP is not responding to unicast dhcp packets, so it's spinning in RENEWING state for some time. > DHCPREQUEST on em0 > iface_timeout[1]: Renewing > iface_timeout: res.tv_sec: 3840, rebinding_time: 3801 > state_transition[em0] Renewing -> Rebinding, timo: 1800 It finally gives up and goes to rebinding which is a broadcast request > DHCPREQUEST on em0 > parse_dhcp, from: 00:01:5c:63:ee:46, to: 1c:1b:0d:e7:08:5c > parse_dhcp: 96.120.12.153:67 -> 73.78.230.64:68 > dhcp_hdr op: Boot Reply (2) > dhcp_hdr htype: Ethernet (1) > dhcp_hdr hlen: 6 > dhcp_hdr hops: 1 > dhcp_hdr xid: 0xb007c248 > dhcp_hdr secs: 0 > dhcp_hdr flags: 0x0 > dhcp_hdr ciaddr: 0.0.0.0 > dhcp_hdr yiaddr: 73.78.230.64 > dhcp_hdr siaddr: 0.0.0.0 > dhcp_hdr giaddr: 96.120.12.153 > dhcp_hdr chaddr: 1c:1b:0d:e7:08:5c (00000000000000000000) > DHO_DHCP_MESSAGE_TYPE: DHCPACK which succeeds... So, why does your internet drop out? If you look at dhcpleasectl -l em0 you'll see that the leasetime was probably zero at the point where dhcpleased transitions to rebinding. So the dhcp server takes the lease away from you. This probably works better, please try it. diff --git engine.c engine.c index 2033ea6ac76..090d1a807bc 100644 --- engine.c +++ engine.c @@ -1394,7 +1394,7 @@ state_transition(struct dhcpleased_iface *iface, enum if_state new_state) if (old_state == IF_RENEWING) { iface->dhcp_server.s_addr = INADDR_ANY; iface->timo.tv_sec = (iface->lease_time - - iface->renewal_time) / 2; /* RFC 2131 4.4.5 */ + iface->rebinding_time) / 2; /* RFC 2131 4.4.5 */ } else iface->timo.tv_sec /= 2; request_dhcp_request(iface); -- I'm not entirely sure you are real.