Startpagina > Netwerkbeheer > nmcli

nmcli: NetworkManager command-line tool

nmcli is a command-line interface tool for controlling NetworkManager. It allows you to easily manage network connections, devices, Wi-Fi, and other network-related settings. It is very useful for automating and configuring networks in server environments or scripts.

Overview

nmcli interacts with the NetworkManager daemon to manage network configurations. You can perform various tasks such as creating, modifying, and deleting connection profiles, enabling/disabling network devices, and scanning and connecting to Wi-Fi.

Key Features

These are the core features provided by nmcli.

  • Network connection profile management (create, modify, delete)
  • View and control network device status
  • Scan and connect to Wi-Fi networks
  • Change connection settings like IP address and DNS server
  • Enable/disable network radios (Wi-Fi, WWAN)

Main Options and Objects

nmcli is used in the format 'nmcli [options] object command'. Here, 'object' refers to the management target (e.g., connection, device), and 'command' specifies the particular action for that object.

Global Options

Gegenereerde opdracht:

Probeer de opdrachtcombinaties.

Uitleg:

`nmcli` Voer het commando uit.

Combineer deze opties en voer de opdracht virtueel uit met de AI.

Usage Examples

Various scenarios for managing networks using nmcli.

Check NetworkManager General Status

nmcli general status

Checks the current status and hostname information of NetworkManager.

View All Network Connection Profiles

nmcli connection show

Displays all connection profiles defined on the system, including active and inactive connections.

View Status of All Network Devices

nmcli device status

Checks the current status of all network devices, such as Ethernet and Wi-Fi.

Scan and List Available Wi-Fi Networks

nmcli device wifi list

Scans for available Wi-Fi networks in the vicinity and displays information such as SSID and signal strength.

Turn Off Wi-Fi Radio

nmcli radio wifi off

Disables the Wi-Fi functionality of the system.

Activate a Specific Connection

nmcli connection up "My_Wired_Connection"

Activates the network connection profile named 'My_Wired_Connection'. Replace with the actual connection name.

Tips & Precautions

Tips and precautions for using nmcli more effectively.

Useful Tips

  • Most nmcli commands require root privileges. Use them with `sudo`.
  • You can get detailed help for specific objects or commands by using `nmcli help` or `nmcli <object> help`.
  • Refer to the full manual page by using `man nmcli`.
  • When using in scripts, it is recommended to combine the `-t` (terse) and `-f` (fields) options to extract only the necessary information.

Hétzelfde categoriecommando