NetworkManager Cheat Sheet
by misterrabinhalder via cheatography.com/35799/cs/19264/
Installation Activity Monitor Examples
RedHat nmcli Observe NetworkManager Listing available Wi-Fi APs
yum install NetworkManager monitor activity nmcli device wifi list
yum install NetworkManager-tui
Showing general information and properties
Networking Control Commands
Archlinux for a Wi-Fi interface
nmcli Enable or disable
pacman -S networkmanager nmcli -p -f general,wifi-properties device
networking [on networking control by
show wlan0
Debian | off] NetworkManager
apt-get install network-manager Listing NetworkManager polkit permissions
nmcli connectivity [check]
networking nmcli general permissions
NetworkManager Initialization connectivity Listing NetworkManager log level and
Systemd [check] domains
systemctl start NetworkManager nmcli general logging
Radio Transmission Control Commands
systemctl enable NetworkManager Changing NetworkManager logging
systemctl status NetworkManager nmcli radio Show or set status of Wi-Fi
nmcli g log level DEBUG domains
wifi [on |
CORE,ETHER,IP
General Commands off]
nmcli g log level INFO domains
nmcli radio Show or set status of WWAN
nmcli general Show overall status of DEFAULT
wifi wwan
status NetworkManager
Activating a VPN connection profile
[on | off]
nmcli general Get and change requiring interactive password input
nmcli radio Show or set all previously
hostname system hostname
nmcli --ask con up my-vpn-con
wifi all [on | mentioned radio switches at
[hostname]
off] the same time Adding a bonding master and two slave
nmcli general Show the permis‐
connection profiles
permissions sions
Secret Agent nmcli con add type bond ifname
nmcli general Get and change
nmcli agent Run nmcli as a Networ‐ mybond0 mode active-backup
logging [level level] NetworkManager
{secret | kManager secret agent, or nmcli con add type ethernet ifname eth1
[domains domain‐ logging level and
polkit | all} polkit agent master mybond0
s...] domains
nmcli con add type ethernet ifname eth2
master mybond0
By misterrabinhalder Published 10th May, 2019. Sponsored by ApolloPad.com
Last updated 26th April, 2019. Everyone has a novel in them. Finish
Page 1 of 4. Yours!
https://apollopad.com
cheatography.com/misterrabinhalder/
NetworkManager Cheat Sheet
by misterrabinhalder via cheatography.com/35799/cs/19264/
Examples (cont) Examples (cont) Examples (cont)
Adding a team master and two slave Adding an ethernet connection profile with Adding an ethernet connection profile in
connection profiles manual IP configuration interactive editor
nmcli con add type team con-name nmcli con add con-name my-con-em1 nmcli connection edit type ethernet
Team1 ifname Team1 config team1-‐ ifname em1 type ethernet ip4 192.168.1‐ print
master-json.conf 00.100/24 gw4 192.168.100.1 ip4 goto ethernet
nmcli con add type ethernet con-name 1.2.3.4 ip6 abbe::cafe goto ipv4.addresses
Team1-slave1 ifname em1 master nmcli con mod my-con-em1 ipv4.dns "‐ set ipv4.gateway 192.168.1.1
Team1 8.8.8.8 8.8.4.4" verify
nmcli con add type ethernet con-name nmcli con mod my-con-em1 +ipv4.dns print
Team1-slave2 ifname em2 master 1.2.3.4 set ipv4.dns 8.8.8.8 8.8.4.4
Team1 nmcli con mod my-con-em1 ipv6.dns "‐ print
nmcli con add type ethernet con-name 2001:4860:4860::8888 2001:4860:48‐ verify
Team1-slave2 ifname em2 master 60::8844" save
Team1 nmcli -p con show my-con-em1 quit
nmcli con up Team1-slave1
Convenient field values retrieval for
nmcli con up Team1-slave2 Running NetworkManager
scripting
Adding a bridge and two slave profiles nmcli -g ip4.address connection show --version | - Print NetworkManager
nmcli con add type bridge con-name my-con-eth0 V software version
TowerBridge ifname TowerBridge nmcli -g ip4.address,ip4.dns connection --help | -h Print NetworkManager
nmcli con add type ethernet con-name show my-con-eth0 options
br-slave-1 ifname ens3 master TowerB‐ nmcli -g ip4 connection show my-con-
--no-d‐ Do not daemonize
ridge eth0
aemon | -n
nmcli con add type ethernet con-name
Adding an Ethernet connection and config‐ --debug | -d Print output to STDOUT
br-slave-2 ifname ens4 master TowerB‐
uring SR-IOV VFs
ridge --pid-file | - Specify location of PID file
nmcli con add type ethernet con-name p
nmcli con modify TowerBridge bridge.stp
EthernetPF ifname em1
no --state-file Specify file for storing state
nmcli con modify EthernetPF sriov.total-
--config Specifiy configuration file
vfs 3 sriov.autoprobe-drivers false
nmcli con modify EthernetPF sriov.vfs '0 --log-level Set NetworkManager logging
mac=00:11:22:33:44:55 vlans=10, 1 --log-‐ List operations to log
trust=true spoof-check=false' domain
nmcli con modify EthernetPF +sriov.vfs
--print-c‐ Print Networkmanger config‐
'2 max-tx-rate=20'
onfig uration
Escaping colon characters in tabular mode
nmcli -t -f general -e yes -m tab dev
show eth0
By misterrabinhalder Published 10th May, 2019. Sponsored by ApolloPad.com
Last updated 26th April, 2019. Everyone has a novel in them. Finish
Page 2 of 4. Yours!
https://apollopad.com
cheatography.com/misterrabinhalder/
NetworkManager Cheat Sheet
by misterrabinhalder via cheatography.com/35799/cs/19264/
Connection Management Commands Connection Management Commands Configuring NetworkManager
(cont)
nmcli connection show [-- List all plugins Lists plugin separated by ','
active] [--order [+-]categ‐ profiles nmcli connection Edit an existing auth-p‐ Whether to use PolicyKit for
ory:...] edit {[id | uuid | path] connection or add a olkit authorization
nmcli connection show [-- Show ID | [type type] [con- new one, using an
dhcp Sets up DHCP client
active] [id | uuid | path | apath] details for name name]} interactive editor
dns Set DNS processing mode e.g.
ID... specified nmcli connection Clone a connection
dnsmasq, systemd-resolved,
connec‐ clone [--temporary]
unbound, none.
tions [id | uuid | path] ID
level Set log level e.g. OFF,ERR,W‐
nmcli connection up [id | uuid | Activate a new_name
ARN,INFO,DEBUG,TRACE
path] ID [ifname ifname] [ap connection nmcli connection Delete a configured
domains Set log domain e.g. NONE,ALL,‐
BSSID] [passwd-file file] delete [id | uuid | connection
DEFAULT,DHCP,IP.
nmcli connection down [id | Deactivate path] ID...
backend Set logging backend e.g. syslog,
uuid | path | apath] ID... a nmcli connection Monitor connection
journal
connection monitor [id | uuid | profile activity
nmcli connection modify [-- Add, path] ID...
Device Management Commands
temporary] [ id | uuid | path ] modify or nmcli connection Reload all
ID {option value | [+|-]sett‐ remove reload connection files nmcli device status Print status
ing.property value} ... properties from disk of devices
nmcli connection add [save Create a nmcli connection Load/reload one or nmcli device show [ifname] Show
{yes | no}] {option value | [+|- new load filename... more connection detailed
]setting.property value} ... connection files from disk information
about
nmcli connection Import an external/‐
devices
import [--temporary] foreign configuration
type type file file nmcli device set [ifname] Set device
ifname [autoconnect {yes properties
nmcli connection Export a connection
|no}] [managed {yes | no}]
export [id | uuid |
path] ID [file] nmcli device connect Connect the
ifname device
nmcli device reapply Attempt to
ifname update
device
By misterrabinhalder Published 10th May, 2019. Sponsored by ApolloPad.com
Last updated 26th April, 2019. Everyone has a novel in them. Finish
Page 3 of 4. Yours!
https://apollopad.com
cheatography.com/misterrabinhalder/
NetworkManager Cheat Sheet
by misterrabinhalder via cheatography.com/35799/cs/19264/
Device Management Commands (cont) Device Management Commands (cont)
nmcli device modify ifname Modify the nmcli device wifi hotspot Create a
{option value | [+|-]setting.pr‐ settings [ifname ifname] [con-name Wi-Fi
operty value} ... name] [ssid SSID] [ band {a | hotspot
nmcli device disconnect Disconnect bg} ] [channel channel]
ifname... a device [password password]
nmcli device delete ifname... Delete a nmcli device wifi rescan Re-scan
device [ifname ifname] [ssid SSID...] for
available
nmclie device monitor [ifnam‐ Monitor
access
e...] device
points
activity
nmcli device lldp [list [ifname Display
nmcli device wifi [list [--rescan List
ifname]] inform‐
| auto | no | yes] [ifname available
ation
ifname] [bssid BSSID]] Wi-Fi
about
access
neighb‐
points
oring
nmcli device wifi connect Connect to
devices
(B)SSID [password password] a Wi-Fi
[wep-key-type {key | phrase}] network
Dispatcher Scripts
[ifname ifname] [bssid BSSID]
Script should be owned by root
[name name] [private {yes |
no}] [hidden {yes | no}] chown root:root /etc/NetworkManager/d‐
ispatcher.d/10-script.sh
Must not be writable by group or other
chmod 755 /etc/NetworkManager/disp‐
atcher.d/10-script.sh
Each script receives two arguments
The first argument is the interface name
The second argument is the network
action e.g. up, down, etc.
By misterrabinhalder Published 10th May, 2019. Sponsored by ApolloPad.com
Last updated 26th April, 2019. Everyone has a novel in them. Finish
Page 4 of 4. Yours!
https://apollopad.com
cheatography.com/misterrabinhalder/