For a system's networking to be configured automatically, a service is typically already in place. Most modern Linux distributions utilize the NetworkManager daemon for this purpose, making it a cornerstone of linux network management.
What is Network Manager in Linux?
If you are using a graphical user interface (GUI), you will likely notice the Network Manager Linux service as an applet on your desktop's taskbar. This tool manages your network hardware and connection information. For example, upon startup, NetworkManager gathers information about network hardware, searches for available connections (such as wireless or wired networks), and then activates them to get you online.
Command-Line Interaction
While the GUI applet is convenient, there are also powerful command-line tools to interact with the networkmanager linux service. These are essential for server administration and scripting.
Using nm-tool
The nm-tool command reports NetworkManager's current state and a list of its managed devices. Note that nm-tool is considered deprecated on many modern systems in favor of nmcli.
pete@icebox:/$ nm-tool
NetworkManager Tool
State: connected (global)
- Device: eth0 [Wired connection 1] -------------------------------------------
Type: Wired
Driver: pcnet32
State: connected
Default: yes
HW Address: 12:3D:45:56:7D:CC
Capabilities:
Carrier Detect: yes
Wired Properties
Carrier: on
IPv4 Settings:
Address: 192.168.22.1
Prefix: 24 (255.255.255.0)
Gateway: 192.168.22.2
DNS: 192.168.22.2
The Modern nmcli Tool
The nmcli command is the primary command-line utility for controlling and modifying the Linux Network Manager. It allows you to view status, manage connections, and configure network devices directly from the terminal. For a complete list of its capabilities, refer to its man page (man nmcli).