Chapter 8. Configuring IP networking with nmtui

The following section provides how you can configure a network interface using the NetworkManager’s tool, nmtui.

8.1. Getting started with nmtui

nmtui is a simple curses-based text user interface (TUI) for NetworkManager.

This procedure describes how to start the text user interface tool, nmtui.

Prerequisites

  • The nmtui tool is used in a terminal window. It is contained in the NetworkManager-tui package, but it is not installed along with NetworkManager by default. To install NetworkManager-tui:

    ~]# yum install NetworkManager-tui
  • To verify that NetworkManager is running, see Section 5.3, “Checking the status of NetworkManager”

Procedure

  1. Start the nmtui tool:

    ~]$ nmtui

    The text user interface appears.

    Figure 8.1. The NetworkManager text user interface starting menu

    nmtui Select an Option
  2. To navigate, use the arrow keys or press Tab to step forwards and press Shift+Tab to step back through the options. Press Enter to select an option. The Space bar toggles the status of a check box.

8.1.1. Adding a connection profile using nmtui

The nmtui application provides a text user interface to NetworkManager. This procedure describes how to add a new connection profile.

Prerequisites

  • The NetworkManager-tui package is installed.

Procedure

  1. Start the NetworkManager text user interface utility:

    # nmtui
  2. Select the Edit a connection menu entry, and press Enter.
  3. Select the Add button, and press Enter.
  4. Select Ethernet, and press Enter.
  5. Fill the fields with the connection details.

    add connection in nmtui
  6. Select OK to save the changes.
  7. Select Back to return to the main menu.
  8. Select Activate a connection, and press Enter.
  9. Select the new connection entry, and press Enter to activate the connection.
  10. Select Back to return to the main menu.
  11. Select Quit.

Verification steps

  1. Display the status of the devices and connections:

    # nmcli device status
    DEVICE      TYPE      STATE      CONNECTION
    enp7s0      ethernet  connected  Example-Connection
  2. To display all settings of the connection profile:

    # nmcli connection show Example-Connection
    connection.id:              Example-Connection
    connection.uuid:            b6cdfa1c-e4ad-46e5-af8b-a75f06b79f76
    connection.stable-id:       --
    connection.type:            802-3-ethernet
    connection.interface-name:  enp7s0
    ...

Additional resources

8.1.2. Applying changes to a modified connection with nmtui

To apply changes after a modified connection which is already active requires a reactivation of the connection. In this case, follow the procedure below:

Procedure

  1. Select the Activate a connection menu entry.

    Figure 8.2. Activating a connection with nmtui

    nmtui Activate a Connection
  2. Select the modified connection. On the right, click the Deactivate button.

    Figure 8.3. Deactivating a modified connection with nmtui

    nmtui Deactivate a Modified Connection
  3. Choose the connection again and click the Activate button.

    Figure 8.4. Reactivating a modified connection with nmtui

    nmtui Activate a Modified Connection

The following commands are also available:

~]$ nmtui edit connection-name

If no connection name is supplied, the selection menu appears. If the connection name is supplied and correctly identified, the relevant Edit connection screen appears.

~]$ nmtui connect connection-name

If no connection name is supplied, the selection menu appears. If the connection name is supplied and correctly identified, the relevant connection is activated. Any invalid command prints a usage message.

Note that nmtui does not support all types of connections. In particular, you cannot edit VPNs, wireless network connections using WPA Enterprise, or Ethernet connections using 802.1X.

Additional resources