cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Etc


Reference














.

os:linux:command:nmcli.html



Linux Commands Cheat Sheet

nmcli : How to use nmcli command in Linux with examples

Help / Manual

# nmcli -h
Usage: nmcli [OPTIONS] OBJECT { COMMAND | help }

OBJECT
  g[eneral]       NetworkManager's general status and operations
  n[etworking]    overall networking control
  r[adio]         NetworkManager radio switches
  c[onnection]    NetworkManager's connections
  d[evice]        devices managed by NetworkManager
  a[gent]         NetworkManager secret agent or polkit agent
# man nmcli

       connection - start, stop, and manage network connections

       device - show and manage network interfaces


List

list devices nmcli device
nmcli device show ← detail
nmcli device show eno1
nmcli d
check connection nmcli connection
nmcli connection show
nmcli connection down eno1
nmcli connection up eno1

Configuration of IP

# nmcli connection modify eno1 ipv4.addresses "192.168.0.100/24 192.168.0.1"
# nmcli connection down eno1 && nmcli connection up eno1
# nmcli device show eno1

Configuration of DNS

# nmcli connection modify eno1 ipv4.dns "192.168.0.100 192.168.0.101"
# nmcli connection down eno1 && nmcli connection up eno1

Configuration of Routing

# nmcli connection modify eno1 ipv4.routes "10.0.0.0/24 192.168.0.1"
# nmcli connection down eno1 && nmcli connection up eno1





Linux Commands Cheat Sheet




os/linux/command/nmcli.html.txt · Last modified: 2019/04/19 by admin

Page Tools