Networkmanager command line

https://fedoraproject.org/wiki/Networking/CLI

Reference Manual: https://people.freedesktop.org/~lkundrak/nm-docs/nm-settings.html

Bridging: https://developer.gnome.org/NetworkManager/stable/nmcli-examples.html

und https://www.hogarthuk.com/?q=node/18

Alle Verbindungen zeigen

nmcli connection show

Nur aktive Verbindungen zeigen

nmcli connection show --active

Verbindung aktivieren

nmcli connection up id <connection name>

Deaktivieren

nmcli connection down id <connection name>

Alle Configs neu laden

nmcli conn reload

Neu anlegen

nmcli connection edit con-name <name of new connection>

Konfigurieren

mit goto navigieren, mit back zurück. describe beschreibt Optionen.

Z.B. mit describe bridge:

===| nmcli interactive connection editor |===
Adding a new 'bridge' connection
Type 'help' or '?' for available commands.
Type 'describe [<setting>.<prop>]' for detailed property description.
You may edit the following settings: connection, bridge, 802-3-ethernet (ethernet), ipv4, ipv6
nmcli> describe
Error: no setting selected; valid are [connection, bridge, 802-3-ethernet (ethernet), ipv4, ipv6]
use 'goto <setting>' first, or 'describe <setting>.<property>'
nmcli> describe bridge
<<<bridge>>>
=== [mac-address] ===
[NM property description]
If specified, the MAC address of bridge. When creating a new bridge, this MAC address will be set. When matching an existing (outside NetworkManager created) bridge, this MAC address must match.
=== [stp] ===
[NM property description]
Controls whether Spanning Tree Protocol (STP) is enabled for this bridge.
=== [priority] ===
[NM property description]
Sets the Spanning Tree Protocol (STP) priority for this bridge. Lower values are "better"; the lowest priority bridge will be elected the root bridge.
=== [forward-delay] ===
[NM property description]
The Spanning Tree Protocol (STP) forwarding delay, in seconds.
=== [hello-time] ===
[NM property description]
The Spanning Tree Protocol (STP) hello time, in seconds.
=== [max-age] ===
[NM property description]
The Spanning Tree Protocol (STP) maximum message age, in seconds.
=== [ageing-time] ===
[NM property description]
The Ethernet MAC address aging time, in seconds.

Mit set wird eine property gesetzt

z.B.

set bridge.stp true

set bridge.mac 78:24:af:88:eb:99

nmcli ipv4> set ipv4.addresses 192.168.72.1
nmcli ipv4>?
------------------------------------------------------------------------------
---[ Main menu ]---
goto [<setting> | <prop>] :: go to a setting or property
remove <setting>[.<prop>] | <prop> :: remove setting or reset property value
set [<setting>.<prop> <value>] :: set property value
describe [<setting>.<prop>] :: describe property
print [all | <setting>[.<prop>]] :: print the connection
verify [all | fix] :: verify the connection
save [persistent|temporary] :: save the connection
activate [<ifname>] [/<ap>|<nsp>] :: activate the connection
back :: go one level up (back)
help/? [<command>] :: print this help
nmcli <conf-option> <value> :: nmcli configuration
quit :: exit nmcli
------------------------------------------------------------------------------

print listet die gesetzten Einstellungen auf.

verify verifiziert die Einstellungen

save persistent sichert die Einstellungen und aktiviert die Verbindung sofort