KEMBAR78
Networkmanager Cheatsheet | PDF | Wi Fi | Domain Name System
0% found this document useful (0 votes)
65 views4 pages

Networkmanager Cheatsheet

The NetworkManager Cheat Sheet provides installation instructions and command examples for managing network connections using nmcli across different Linux distributions. It covers various functionalities such as monitoring network activity, managing connections, and configuring device settings. Additionally, it includes commands for creating Wi-Fi hotspots, modifying connection properties, and utilizing dispatcher scripts.

Uploaded by

vhhj2017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views4 pages

Networkmanager Cheatsheet

The NetworkManager Cheat Sheet provides installation instructions and command examples for managing network connections using nmcli across different Linux distributions. It covers various functionalities such as monitoring network activity, managing connections, and configuring device settings. Additionally, it includes commands for creating Wi-Fi hotspots, modifying connection properties, and utilizing dispatcher scripts.

Uploaded by

vhhj2017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

NetworkManager Cheat Sheet

by misterrabinhalder via cheatography.com/35799/cs/19264/

Instal​lation Activity Monitor Examples

RedHat nmcli Observe Networ​kMa​nager Listing available Wi-Fi APs


yum install Networ​​kM​a​nager monitor activity nmcli device wifi list
yum install Networ​​kM​a​n​ag​​er-​tui
Showing general inform​ation and properties
Networking Control Commands
Archlinux for a Wi-Fi interface
nmcli Enable or disable
pacman -S networ​kma​nager nmcli -p -f genera​l,w​ifi​-pr​ope​rties device
networking [on networking control by
show wlan0
Debian | off] Networ​kMa​nager
apt-get install networ​k-m​anager Listing Networ​kMa​nager polkit permis​sions
nmcli connec​tivity [check]
networking nmcli general permis​sions
Networ​kMa​nager Initia​liz​ation connec​tivity Listing Networ​kMa​nager log level and
Systemd [check] domains

systemctl start Networ​kMa​nager nmcli general logging


Radio Transm​ission Control Commands
systemctl enable Networ​kMa​nager Changing Networ​kMa​nager logging
systemctl status Networ​kMa​nager nmcli radio Show or set status of Wi-Fi
nmcli g log level DEBUG domains
wifi [on |
CORE,E​THER,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 Networ​kMa​nager
Activating a VPN connection profile
[on | off]
nmcli general Get and change requiring intera​ctive 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
permis​sions 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] Networ​kMa​nager
{secret | kMa​nager 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 config​uration intera​ctive 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.16​8.1​‐ print
mas​ter​-js​on.conf 00.1​00/24 gw4 192.16​8.100.1 ip4 goto ethernet
nmcli con add type ethernet con-name 1.2.3.4 ip6 abbe::cafe goto ipv4.a​ddr​esses
Team1-​slave1 ifname em1 master nmcli con mod my-con-em1 ipv4.dns "​‐ set ipv4.g​ateway 192.16​8.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 200​1:4​860​:48​60:​:8888 2001:4​860​:48​‐ verify
Team1-​slave2 ifname em2 master 60:​:88​44" 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 Networ​kMa​nager
scripting
Adding a bridge and two slave profiles nmcli -g ip4.ad​dress connection show --version | - Print Networ​kMa​nager
nmcli con add type bridge con-name my-con​-eth0 V software version
TowerB​ridge ifname TowerB​ridge nmcli -g ip4.ad​dre​ss,​ip4.dns connection --help | -h Print Networ​kMa​nager
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 TowerB​ridge bridge.stp
EthernetPF ifname em1
no --stat​e-file Specify file for storing state
nmcli con modify EthernetPF sriov.t​ot​al-
--config Specifiy config​uration file
vfs 3 sriov.a​ut​opr​obe​-dr​ivers false
nmcli con modify EthernetPF sriov.vfs '0 --log-​level Set Networ​kMa​nager logging
mac=00​:11​:22​:33​:44:55 vlans=10, 1 --log-​‐ List operations to log
trust=true spoof-​che​ck=​false' domain
nmcli con modify EthernetPF +sriov.vfs
--prin​t-c​‐ Print Networ​kmanger config​‐
'2 max-tx​-ra​te=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 Config​uring Networ​kMa​nager


(cont)
nmcli connection show [-- List all plugins Lists plugin separated by ','
active] [--order [+-]ca​teg​‐ profiles nmcli connection Edit an existing auth-p​‐ Whether to use PolicyKit for
ory​:...] edit {[id | uuid | path] connection or add a olkit author​ization
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]} intera​ctive editor
dns Set DNS processing mode e.g.
ID... specified nmcli connection Clone a connection
dnsmasq, system​d-r​eso​lved,
connec​‐ clone [--tem​porary]
unbound, none.
tions [id | uuid | path] ID
level Set log level e.g. OFF,ER​R,W​‐
nmcli connection up [id | uuid | Activate a new_name
ARN​,IN​FO,​DEB​UG,​TRACE
path] ID [ifname ifname] [ap connection nmcli connection Delete a configured
domains Set log domain e.g. NONE,A​LL,​‐
BSSID] [passw​d-file file] delete [id | uuid | connection
DEF​AUL​T,D​HCP,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
tem​porary] [ id | uuid | path ] modify or nmcli connection Reload all
ID {option value | [+|-]s​ett​‐ remove reload connection files nmcli device status Print status
ing.pr​operty value} ... properties from disk of devices

nmcli connection add [save Create a nmcli connection Load/r​eload one or nmcli device show [ifname] Show
{yes | no}] {option value | [+|- new load filena​me... more connection detailed
]s​ett​ing.pr​operty value} ... connection files from disk inform​ation
about
nmcli connection Import an extern​al/​‐
devices
import [--tem​porary] foreign config​uration
type type file file nmcli device set [ifname] Set device
ifname [autoc​onnect {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 | [+|-]s​ett​ing.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-k​ey-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/N​etw​ork​Man​age​r/d​‐
isp​atc​her.d/​10-​scr​ipt.sh

Must not be writable by group or other


chmod 755 /etc/N​etw​ork​Man​age​r/d​isp​‐
atc​her.d/​10-​scr​ipt.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/

You might also like