Skip to content

Commit

Permalink
net/dhcp: bump dhcpcd timeout to 300s (#5127)
Browse files Browse the repository at this point in the history
On most distros, including Ubuntu, the default timeout for dhclient is 300s.
There is no cloud-init controlled duration for the dhclient process as
it doesn't fork until after it receives an IP address and there is no timeout
value passed to subp().

I have seen some distros configure dhclient with a timeout of 60s, but
is far less common.

Given that a cloud VM is not very useful with DHCP, err on the generous
side and allow up to 300 seconds for dhcpcd to get an address.

Note that there is still an issue with dhcpcd retries which will be
addressed later in a separate PR.

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
  • Loading branch information
cjp256 committed Apr 1, 2024
1 parent f0fb841 commit 372e80f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cloudinit/net/dhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ def get_key_from_latest_lease(self, distro, key: str):

class Dhcpcd(DhcpClient):
client_name = "dhcpcd"
timeout = 300

def dhcp_discovery(
self,
Expand Down

0 comments on commit 372e80f

Please sign in to comment.