Chapter 22. 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.
22.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
Note that RHEL does not provide
dhcpcd and, therefore, NetworkManager can not use this client.
/etc/NetworkManager/conf.d/dhcp-client.conffile with the following content:
You can set the
If you set the
dhclient, install the
# yum install dhcp-client
# systemctl restart NetworkManager
Note that the restart temporarily interrupts all network connections.
Search in the
/var/log/messageslog file for an entry similar to the following:
Apr 26 09:54:19 server NetworkManager: <info> [1650959659.8483] dhcp-init: Using DHCP client 'dhclient'
This log entry confirms that NetworkManager uses
dhclientas DHCP client.
22.2. Configuring the DHCP 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 configured a connection to retrieve an IP address from a DHCP server, the NetworkManager requests an IP address from a DHCP server. By default, the client waits 45 seconds for this request to be completed. When a
DHCP connection is started, a dhcp client requests an IP address from a
- A connection that uses DHCP is configured on the host.
ipv6.dhcp-timeoutproperties. For example, to set both options to
# nmcli connection modify connection_name ipv4.dhcp-timeout 30 ipv6.dhcp-timeout 30
Alternatively, set the parameters to
infinityto 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:
# nmcli connection modify connection_name ipv4.may-fail value
If you set the
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:
autoconnectproperty of the connection is enabled, NetworkManager retries to activate the connection as many times as set in the
autoconnect-retriesproperty. The default is
- 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.
- If the
Optional: Configure the behavior if NetworkManager does not receive an IPv6 address before the timeout:
# nmcli connection modify connection_name ipv6.may-fail value