LinuxCommandLibrary

nmcli-networking

Manage NetworkManager from the command line

TLDR

Show the networking status of NetworkManager

$ nmcli networking
copy

Enable or disable networking and all interfaces managed by NetworkManager
$ nmcli networking [on|off]
copy

Show the last known connectivity state
$ nmcli networking connectivity
copy

Show the current connectivity state
$ nmcli networking connectivity check
copy

SYNOPSIS

nmcli [OPTIONS] OBJECT {COMMAND | help}

PARAMETERS

connection
    Manage network connections.

device
    Manage network devices.

general
    Get general NetworkManager status.

networking
    Enable or disable networking.

radio
    Control Wi-Fi, WWAN, and Bluetooth radios.

monitor
    Monitor NetworkManager events.

help
    Display help information.

-t, --terse
    Use terse output format.

-p, --pretty
    Use pretty output format.

-m, --mode
    Specify output mode: tabular, multiline, or list.

-f, --fields
    Specify fields to output.

-e, --escape
    Specify escape mode: yes, no, auto.

-w, --wait
    Wait for an operation to complete.

-W, --nowait
    Do not wait for an operation to complete.

DESCRIPTION

nmcli is a command-line tool for controlling NetworkManager. It allows you to create, display, edit, delete, activate, and deactivate network connections, as well as control network devices. It is a powerful utility for managing network configurations without relying on a graphical user interface. nmcli can manage various connection types including Ethernet, Wi-Fi, VPN, VLAN and many others.
It can be used to script network management tasks. It interacts with NetworkManager which has to be running. Many Linux distributions provide it by default. nmcli allows to inspect the status of your network interfaces and connections. It is usually used on headless systems or servers.

EXAMPLES

List all network connections:
nmcli connection show
Activate a connection:
nmcli connection up 'My Wired Connection'
Disable a connection:
nmcli connection down 'My Wired Connection'
Show status for one network device:
nmcli device show eth0

HISTORY

nmcli was developed as a command-line tool to interact with NetworkManager. Its development aimed to provide a non-GUI alternative for managing network connections, making it suitable for server environments and automation scripts. It is actively maintained and widely used across various Linux distributions. The command evolved over time to support new features of NetworkManager, adapting to changes in networking technologies.

SEE ALSO

nmcli(1), NetworkManager.conf(5)

Copied to clipboard