Chapter 20. Configuring NetworkManager DHCP settings NetworkManager provides different configuration options related to DHCP. For example, you can configure NetworkManager to use the build-in DHCP client (default) or an external client, and you can influence DHCP settings of individual profiles. 20.1. Changing the DHCP client of NetworkManager By default, NetworkManager uses its internal DHCP client. However, if you require a DHCP client with features that the built-in client does not provide, you can alternatively configure NetworkManager to use dhclient . Note that RHEL does not provide dhcpcd and, therefore, NetworkManager can not use this client. Procedure Create the /etc/NetworkManager/conf.d/dhcp-client.conf file with the following content: You can set the dhcp parameter to internal (default) or dhclient . If you set the dhcp parameter to dhclient , install the dhcp-client package: Restart NetworkManager: Note that the restart temporarily interrupts all network connections. Verification Search in the /var/log/messages log file for an entry similar to the following: This log entry confirms that NetworkManager uses dhclient as DHCP client. Additional resources NetworkManager.conf(5) man page on your system 20.2. Configuring the DHCP timeout behavior of a NetworkManager connection A Dynamic Host Configuration Protocol (DHCP) client requests the dynamic IP address and corresponding configuration information from a DHCP server each time a client connects to the network. When you enable DHCP in a connection profile, NetworkManager waits, by default, 45 seconds for this request to be completed. Prerequisites A connection that uses DHCP is configured on the host. Procedure Optional: Set the ipv4.dhcp-timeout and ipv6.dhcp-timeout properties. For example, to set both options to 30 seconds, enter: Alternatively, set the parameters to infinity to configure that NetworkManager does not stop trying to request and renew an IP address until it is successful. Optional: Configure the behavior if NetworkManager does not receive an IPv4 address before the timeout: If you set the ipv4.may-fail option to: yes , the status of the connection depends on the IPv6 configuration: If the IPv6 configuration is enabled and successful, NetworkManager activates the IPv6 connection and no longer tries to activate the IPv4 connection. If the IPv6 configuration is disabled or not configured, the connection fails. no , the connection is deactivated. In this case: If the autoconnect property of the connection is enabled, NetworkManager retries to activate the connection as many times as set in the autoconnect-retries property. The default is 4 . If the connection still cannot acquire a DHCP address, auto-activation fails. Note that after 5 minutes, the auto-connection process starts again to acquire an IP address from the DHCP server. Optional: Configure the behavior if NetworkManager does not receive an IPv6 address before the timeout: Additional resources nm-settings(5) man page on your system

Commands:
[main] dhcp=dhclient
dnf install dhcp-client
systemctl restart NetworkManager
Apr 26 09:54:19 server NetworkManager[27748]: <info> [1650959659.8483] dhcp-init: Using DHCP client 'dhclient'
nmcli connection modify <connection_name> ipv4.dhcp-timeout 30 ipv6.dhcp-timeout 30
nmcli connection modify <connection_name> ipv4.may-fail <value>
nmcli connection modify <connection_name> ipv6.may-fail <value>