{"id":320,"date":"2023-09-02T11:20:44","date_gmt":"2023-09-02T09:20:44","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=320"},"modified":"2023-09-02T11:20:45","modified_gmt":"2023-09-02T09:20:45","slug":"nmcli-und-nmtui-netzwerkkonfiguration-unter-linux-am-terminal","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2023\/09\/02\/nmcli-und-nmtui-netzwerkkonfiguration-unter-linux-am-terminal\/","title":{"rendered":"nmcli und nmtui &#8211; Netzwerkkonfiguration unter Linux am Terminal"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Solange man unter Linux mit einem Netzwerkkabel (<em>Ethernet<\/em>) mit dem Router verbunden ist, ist ein manuelles Eingreifen \u00fcber den Network-Manager (Netzwerk-Manager) eigentlich \u00fcberhaupt nicht n\u00f6tig &#8211; das System verbindet sich \u00fcber diesen automatisch mit diesem und hat so Verbindung zum Internet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nutzt man stattdessen WLAN (<em>Wi-Fi \/ WiFi<\/em>) oder mobiles Breitband ist dieser nat\u00fcrlich schon n\u00f6tig (<em>hier unter\u00a0KDE<\/em>):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1024x576.jpg\" alt=\"\" class=\"wp-image-321\" style=\"width:700px;height:394px\" width=\"700\" height=\"394\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager.jpg 1920w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Aber auch ohne grafische Oberfl\u00e4che muss man sich nicht unbedingt viel am\u00a0Terminal\u00a0auskennen. Sie melden sich im gestarteten System am Terminal an &#8211; administrative Rechte sind dazu unter normalen Umst\u00e4nden nicht n\u00f6tig &#8211; f\u00fchren Sie einfach einmal als normaler Benutzer folgenden Befehl am Terminal aus:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli general permissions<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Erhalten Sie folgende Meldung:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1-1024x576.jpg\" alt=\"\" class=\"wp-image-322\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Also &#8222;<strong>ja<\/strong>&#8220; haben Sie alle Rechte &#8211; Sie k\u00f6nnen also das Netzwerk ohne administrative Rechte arbeiten. Am Terminal k\u00f6nnen Sie mit folgenden beiden Werkzeugen die Verbindung konfigurieren:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">nmcli &#8211; Mehr Terminal<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Der reine Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">zeigt zu Beginn einmal Informationen zur aktuellen Verbindung und zu Einstellungen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-2-1024x576.jpg\" alt=\"\" class=\"wp-image-323\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-2-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-2-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-2-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-2-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-2.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit dem Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli device<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">erhalten wir Informationen \u00fcber die eingesetzten Netzwerk-Schnittstellen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DEVICE  TYPE      STATE            CONNECTION         \nwlan0   wifi      verbunden        Linux-Bibel-Online \nlo      loopback  nicht verwaltet  -- <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Durch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">kommen wir wieder an Informationen zur aktuellen Verbindung:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NAME                      UUID                                  TYPE  DEVICE \nLinux-Bibel-Online        d2902063-7e17-4d5f-84a3-8a9f5c1bc6b9  wifi  wlan0  \nMarcel und Juliette Wlan  ebcae111-1cfa-40bd-9ce5-d5f65bd3097c  wifi  --<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Alle bisher genutzten Verbindungen k\u00f6nnen wir uns im Systemverzeichnis &#8222;<em>\/etc\/NetworkManager\/system-connections\/<\/em>&#8220; ansehen, wir wechseln in dieses Verzeichnis und lassen uns den Inhalt anzeigen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/etc\/NetworkManager\/system-connections\/\nls<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In meinem Beispiel lautet die Ausgabe:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> Linux-Bibel-Online-d2902063-7e17-4d5f-84a3-8a9f5c1bc6b9.nmconnection\n Linux-Bibel-Online.nmconnection\n'Marcel und Juliette Wlan.nmconnection'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Jetzt k\u00f6nnen wir uns die Dateien ansehen &#8211; jede Datei entspricht einer genutzten Verbindung, hierzu ben\u00f6tigen wir administrative Rechte:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat Linux-Bibel-Online.nmconnection<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In meinem Beispiel:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;connection]\nid=Linux-Bibel-Online\nuuid=5a7c4a54-1fod-4aaf-be896-fd7a46e24d142\ntype=wifi\ninterface-name=wlan0\npermissions=user:siducer:;\n\n&#91;wifi]\nmac-address-blacklist=\nmode=infrastructure\nssid=Linux-Bibel-Online\n\n&#91;wifi-security]\nauth-alg=open\nkey-mgmt=wpa-psk\npsk-flags=1\n\n&#91;ipv4]\ndns-search=\nmethod=auto\n\n&#91;ipv6]\naddr-gen-mode=stable-privacy\ndns-search=\nmethod=auto\n\n&#91;proxy]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wir haben uns nun diverse Informationen beschafft &#8211; dies ist eigentlich nicht n\u00f6tig, zeigt aber wie Sie diese finden, wenn n\u00f6tig. Nun, wir wollen WLAN aktivieren:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli radio wifi on<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Nutzen wir statt &#8222;<strong>on<\/strong>&#8220; die Option &#8222;<strong>off<\/strong>&#8220; w\u00fcrden wir WLAN wieder deaktivieren. Jetzt wollen wir uns die in der N\u00e4he zu findenden Netzwerke anzeigen lassen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli device wifi list<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-3-1024x576.jpg\" alt=\"\" class=\"wp-image-324\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-3-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-3-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-3-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-3-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-3.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Aktualisieren k\u00f6nnen wir diese Liste mit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli device wifi rescan<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Um uns mit einem der angezeigten Netzwerke zu verbinden, brauchen wir nun die angezeigte SSID und nat\u00fcrlich das Passwort. In diesem Beispiel die SSID &#8222;Linux-Bibel-Online&#8220; &#8211; besteht die SSID aus Zeichenfolgen mit Leerzeichen, setzen Sie diese unter Anf\u00fchrungszeichen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli device wifi connect \"Linux-Bibel-Online\" password Passwort<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Mit der Option &#8222;<strong>password<\/strong>&#8220; geben Sie nat\u00fcrlich das Passwort an. Umst\u00e4ndlicher wird dies mit einem versteckten Netzwerk &#8211; erst die Befehle und anschlie\u00dfend folgt die Erkl\u00e4rung:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection add type wifi con-name Name ifname DEVICE ssid VERSTECKTE-SSID\nnmcli connection modify NAME wifi-sec.key-mgmt wpa-psk wifi-sec.psk PASSWORT\nnmcli connection up NAME<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sie m\u00fcssen nur die gro\u00df geschriebenen W\u00f6rter anpassen:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>DEVICE<\/strong>&nbsp;&#8211; Die Netzwerk-Schnittstelle<\/li>\n\n\n\n<li><strong>VERSTECKTE-SSID<\/strong>&nbsp;&#8211; Der Name des WLAN-Netzwerkes<\/li>\n\n\n\n<li><strong>NAME<\/strong>&nbsp;&#8211; Ein von Ihnen vergebener Name f\u00fcr die Netzwerk-Verbindung<\/li>\n\n\n\n<li><strong>PASSWORT<\/strong>&nbsp;&#8211; Das Passwort f\u00fcr das Netzwerk<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Haben Sie sich einmal mit einem Netzwerk verbunden, brauchen Sie kein Passwort mehr angeben &#8211; Sie k\u00f6nnen auch den Befehl abk\u00fcrzen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli c u \"Linux-Bibel-Online\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">M\u00f6chten Sie eine gespeicherte Verbindung l\u00f6schen &#8211; ganz einfach:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection delete \"Linux-Bibel-Online\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">nmtui &#8211; Grafische Oberfl\u00e4che am Terminal<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Haben Sie es nicht so mit dem Tippen, nutzen Sie einfach etwas mehr grafische Oberfl\u00e4che &#8211; ganz einfach:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmtui<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-4-1024x576.jpg\" alt=\"\" class=\"wp-image-325\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-4-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-4-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-4-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-4-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-4.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mir den\u00a0<strong><kbd>Pfeiltasten<\/kbd><\/strong>\u00a0navigieren Sie durch das Men\u00fc und best\u00e4tigen mit\u00a0<strong><kbd>Eingabe<\/kbd><\/strong>\u00a0&#8211; hier etwa &#8222;<em>Verbindung aktivieren<\/em>&#8222;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-5-1024x576.jpg\" alt=\"\" class=\"wp-image-326\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-5-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-5-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-5-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-5-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/network-manager-5.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Wie auf der grafischen Oberfl\u00e4che &#8211; nur k\u00f6nnen Sie keine Maus nutzen, sie nutzen die\u00a0<strong><kbd>Pfeiltasten<\/kbd><\/strong>\u00a0und\u00a0<strong><kbd>Eingabe<\/kbd><\/strong>, um auf andere Schalter zu wechseln (<em>etwa &#8222;Abbrechen&#8220;, &#8222;OK&#8220;<\/em>) nutzen Sie die\u00a0<strong><kbd>Tabulator<\/kbd><\/strong>-Taste. Einfacher geht es gar nicht.<\/p>\n<div class=\"pld-like-dislike-wrap pld-custom\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir\" data-post-id=\"320\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Hoch.png\" alt=\"Gef\u00e4llt mir\" \/>\r\n            <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">4    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir nicht\" data-post-id=\"320\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Runter.png\" alt=\"Gef\u00e4llt mir nicht\" \/>\r\n            <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Solange man unter Linux mit einem Netzwerkkabel (Ethernet) mit dem Router verbunden ist, ist ein manuelles Eingreifen \u00fcber den Network-Manager (Netzwerk-Manager) eigentlich \u00fcberhaupt nicht n\u00f6tig &#8211; das System verbindet sich \u00fcber diesen automatisch mit diesem und hat so Verbindung zum Internet. Nutzt man stattdessen WLAN (Wi-Fi \/ WiFi) oder mobiles Breitband ist dieser nat\u00fcrlich schon [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":326,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,4],"tags":[12,39,7,6],"class_list":["post-320","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-netzwerk","category-terminal","tag-kommandozeile","tag-netzwerk","tag-shell","tag-terminal"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=320"}],"version-history":[{"count":1,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/320\/revisions"}],"predecessor-version":[{"id":327,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/320\/revisions\/327"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/326"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}