Updated April 15, 2023
Introduction to Linux Network Manager
In the Linux ecosystem, the network manager is a vibrant network control and configuration system. It helps to keep the network-related devices up and running. It also plays an important role to keep the live connection up and running when they are active in the environment. In the Linux environment, the network manager is having its own core daemon. The network manager helps to configure different connection like mobile broadband (such as cellular 3G), Ethernet (eth0), wireless, mobile broadband (such as cellular network like 2G, 3G, etc.), DSL and Point-to-Point over Ethernet (PPPoE), static routes, network aliases, DNS information, and different VPN connections.
Syntax of Text Editors
nmcli [OPTIONS...] {help | general | networking | radio | connection | device | agent | monitor} [COMMAND] [ARGUMENTS...]
nmtui
- nmcli: We can use the “nmcli” keyword in the syntax or command. It will take different arguments like OPTION, command, and different arguments. As per the provided arguments, it will activate or deactivate the network connections, creates, edit, display, delete, and help to display the network device status.
- OPTION: We can provide the different flags to be compatible with the “nmcli and nmtui” command.
- nmtui: If we need to control the network manager via GUI, then we need to use the nmtui utility.
How does Linux network manager Command work?
Before Linux environment 6, there is no concept of a network manager. The networking thing governs by the network administrator tool. The network administrator tool will take care of all the network activities in the Linux older versions. From Linux 6 (CentOS or RHEL), the network administrator tool will replace by the network manager. It will give the enriched functionality like mobile broadband configuration and user-specific network configuration. It can also provide the functionality to change or edit the interface configuration files from the Linux environment.
There are two ways to the manager or control the network manager in the Linux environment, i.e. mncli and mntui.
- nmcli: The nmcli is a command-line tool for controlling or managing the network manager in the Linux environment. It also helps with the reporting network status also. We can also use the nmcli (command-line tool) as a replacement for graphical clients, nm-applet or other. It is also used to activate or deactivate the network connections, create, edit, display, delete, and help to display the network device status.
- nmtui: Basically, the nmtui is a curses-based TUI application. It will help for interacting with the network manager. With the help of the nmtui utility, we can graphically add the hostname, set the IP address to the specific network interfaces, etc.
Examples to implement Linux Network Manager Command
Different examples are mentioned below:
Example #1 – To check the Device
While working with the Linux environment, first, we need to check the status of the current network status of the attached devices. In the nmcli command, we are able to check the current network device’s status.
Command:
nmcli dev status
Explanation:
As per the above command, we are able to check the current status of network devices attached to the Linux environment. There are four devices is attached, but two are connected, and two devices are in an unmanaged state.
Output:
Example #2 – To check the Connection Status
We have seen the network devices status, but we can also check the connection status of the server. It is very important to check when we are connecting the multiple NIC or the different network devices to the live system.
Command:
nmcli con show
Explanation:
As per the above command, we can get the detail information about the connection status of the live environment. There are two live connections, and for further network debugging, we can also use the UUID.
Output:
Example #3 – Add New connection
In the nmcli command, we are having the functionality to add the new connection in the environment. We can also add the new IP address with the gateway IP also.
Command:
nmcli con add type ethernet con-name elearning ifname enp0s8 ip4 192.168.56.60/24
Explanation:
As per the above command, we are able to add the new connection in the Linux environment. The new connection name is “elearning”, and we are setting the IP address, i.e. “192.168.56.60”.
Note: Once the new connection will add. It will not be automatically activated. We need to activate the new connection manually (if you would not need to restart the server)
Output:
Screenshot 1 (a)
Screenshot 1 (b)
Example #4 – Connection Down
As per the requirement, we can disconnect or down the network interface from the Linux environment. We just need to define the interface name in the nmcli command.
Command:
nmcli con down enp0s3
Explanation:
As per the above command, we are disconnecting the network interface “enp0s3” from the Linux environment. Once it will disconnect, then further communication will not happen with this network card.
Output:
Example #5 – Connection Up
We are having the functionality to down the interface. Similarly, we can also up the device or network interface from a disconnected state to an up or running state. We just need to define the interface name in the nmcli command.
Command:
nmcli con up enp0s3
Explanation:
As per the above command, we are connecting the network interface “enp0s3” from the Linux environment. Once it connects, then further communication will happen with this network card.
Output:
Example #6 – “nmtui” Command
In-network manager, if we want to set the hostname or network interface via GUI, then we need to use the “nmtui” functionally. It will help to edit or configure the different network-related activities via GUI mode.
Command:
nmtui
Explanation:
As per the requirement, we can configure the network activities via GUI.
Output:
Conclusion
We have seen the uncut concept of “Linux Network Manager” with the proper example, explanation, and command with different outputs. As per the Linux administrator point of view, the Linux network manager is very important. It helps to manage and control the complete network environment. We can add and configure new or existing network devices in the Linux environment.
Recommended Articles
We hope that this EDUCBA information on “Linux Network Manager” was beneficial to you. You can view EDUCBA’s recommended articles for more information.