الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

nmtui

A menu in the terminal to edit NetworkManager connections, activate them and set the host name.

المستوى
امتحان RHCSA
المجموعة
الشبكة
يحتاج root
نعم
الحزمة
NetworkManager-tui
يُسمّى أيضًا
nmtui-edit, nmtui-connect, nmtui-hostname

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

ماذا يفعل

nmtui (NetworkManager text user interface) gives the same settings as nmcli, but with menus: use the arrow keys, Tab, Space and Enter.

It is a quick and safe way on the exam to set IP addresses, gateway and DNS. After editing a running connection, activate it again ("Activate a connection": deactivate and activate) so the new settings are used.

The package NetworkManager-tui may need to be installed.

طريقة الكتابة

nmtui [edit [CONNECTION] | connect [CONNECTION] | hostname [NAME]]
nmtui-edit [CONNECTION]
nmtui-connect [CONNECTION]
nmtui-hostname [NAME]

الأجزاء الرئيسية

edit, nmtui-edit
Open the editor (for one connection or the list).
connect, nmtui-connect
Activate or deactivate connections.
hostname, nmtui-hostname
Set the host name.

الخيارات 2

الأكثر استخدامًا

-h, --help
Show help.
-v, --version
Show the version.

أمثلة 10

$ مستخدم عادي# بصلاحية root (أو مع sudo)

  1. 1Open the main menu

    nmtui

    Edit a connection / Activate a connection / Set system hostname.

  2. 2Edit one connection directly

    nmtui edit enp1s0

    Set IPv4 to Manual and add address, gateway and DNS.

  3. 3Re-activate after a change

    nmtui connect enp1s0

    Or: nmcli con up enp1s0. Without it the old settings stay active.

  4. 4Set the host name

    nmtui hostname server1.example.com

    Same as hostnamectl set-hostname.

  5. 5Install it when it is missing

    dnf install -y NetworkManager-tui

    Part of the RHEL BaseOS repo.

  6. 6Check the result with nmcli

    nmcli con show enp1s0 | grep ipv4

    nmtui writes the same keyfile that nmcli uses.

  7. 7Check the address after activation

    ip -br addr show enp1s0
    enp1s0  UP  192.168.122.10/24

    The new address is active.

  8. 8Work over SSH safely

    nmtui

    Changing the IP you are connected to ends your SSH session — use a console or plan it.

  9. 9Use it on a small terminal

    TERM=xterm-256color nmtui

    Fixes broken drawing on some consoles.

  10. 10Find the keyfile it wrote

    ls /etc/NetworkManager/system-connections/
    enp1s0.nmconnection

    Settings are saved here.

انتبه

  • Mark "Automatically connect" or the connection does not come up after a reboot.
  • An address needs a prefix: 192.168.122.10/24, not only the IP.

الملفات

/etc/NetworkManager/system-connections/
The connection files.

رموز الخروج

0Done.
1Error.

الدليل الكامل

هذه الصفحة تشرح الأمر بكلمات بسيطة. الدليل الأصلي فيه كل التفاصيل.

في الطرفية: man nmtui