Networkmanager command line

Alle Verbindungen zeigen bzw. nur aktive:

nmcli connection show

nmcli connection show --active

Verbindung aktivieren

nmcli connection up id <connection name>

Deaktivieren

nmcli connection down id <connection name>

Löschen

nmcl connection delete [xxxx]

Alle Configs neu laden

nmcli conn reload

Neu anlegen

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

Bridge anlegen

Doku: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Network_Bridging_Using_the_NetworkManager_Command_Line_Tool_nmcli.html

und https://fedoramagazine.org/build-network-bridge-fedora/

nmcli connection add ifname br0 type bridge con-name br0

Ethernet Schnittstelle hinzufügen

nmcli connection add type bridge-slave ifname eth1 master br0

Verbindung 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

  • networkmanager.txt
  • Zuletzt geändert: vor 20 Monaten
  • von thommie