In Fedora 40 and later versions, the use of the dhcpd service is no longer recommended. NetworkManager now handles DHCP instead, providing a more user-friendly and efficient network management experience. This article will guide you through the process of using NetworkManager and its command-line tool, nmcli, to manage your network interfaces, replacing the traditional drop dhcpd command.
Understanding NetworkManager and nmcli
NetworkManager is a system service that enables efficient network configuration and management. It provides automatic network detection and configuration, and allows settings to be configured through a graphical user interface (GUI) or the command line. The nmcli tool is a command-line interface for NetworkManager, which can be used to view and control network devices and connections.
Installing nmcli
If you do not have nmcli installed on your Fedora system, you can install it using the following command:
sudo dnf install NetworkManager-cli
Managing Network Interfaces with nmcli
To manage network interfaces with nmcli, first, you need to check the current status of the network interfaces by using the following command:
nmcli device status
This will display the list of network interfaces and their current status. Take note of the DEVICE column, as you will need it for subsequent commands. Next, you can obtain more information about a specific network interface by using the following command:
nmcli -t device show
Here, replace with the name of the network interface obtained from the previous step.
Configuring Network Connections with nmcli
To configure network connections in a terminal, you can create, edit, activate, or delete connections using nmcli. The following sections demonstrate the usage of each function.
Creating a Network Connection
To create a new network connection, use the following command:
nmcli connection add ifname con-name type
Replace the following:
: The name of the network interface.: An arbitrary name for the network connection.: The type of connection, such asethernetorwifi.
Editing a Network Connection
To edit an existing network connection, use the following command:
nmcli connection modify
Replace the following:
: The name of the network connection you wish to modify.: The name of the connection setting you wish to modify.: The new value for the setting.
Activating and Deactivating a Network Connection
To activate or deactivate a network connection, use the following commands:
nmcli connection up
nmcli connection down
Replace with the name of the desired network connection.
Deleting a Network Connection
To delete a network connection, use the following command:
nmcli connection delete
Replace with the name of the network connection to delete.
In this article, you have learned about NetworkManager and its command-line tool, nmcli, for network management in Fedora 40 and later. By replacing the traditional drop dhcpd command, you can create and manage network connections more efficiently, ensure proper configuration, and maintain a stable network environment.