nmcli Command
Purpose
Displays network device and connection status in a restricted environment. Configuration changes are not allowed.
Syntax
nmcli subcommand
Description
The nmcli command is a command-line tool that controls the network manager. In a restricted environment, only read-only operations are supported. The nmcli command provides information about network devices, connections, and system hostname as managed by the network manager.
Subcommand
| Subcommand | Description |
|---|---|
| device show <interface> | Displays detailed properties of the specified network device. If no interface is specified, the device show command displays detailed properties about all the network devices. |
| connection show <interface> | Lists connection profiles that are associated with the specified interface. If no interface is specified, the connection show command lists all the known connection profiles. |
| connection show --active | Lists only the connection profiles that are active. |
| -g NAME,DEVICE con show --active | Displays only the NAME and DEVICE fields of active connections. |
| general status | Displays the overall status of the network manager. |
| general hostname | Displays the hostname as set by the network manager. |
Examples
- To display the status of all the devices, enter the following
command:
nmcli device status - To display detailed information for the interface
env10, enter the following command:nmcli device show env10 - To display the NAME and DEVICE fields of all the active connections, enter the following
command:
nmcli -g NAME,DEVICE con show --active - To display the hostname that is set by the network manager, enter the following
command:
nmcli general hostname