nmtui - NetworkManager Text User Interface

Quick Launch: nmtui
Purpose: Interactive text-based menu for managing NetworkManager connections
Best For: Users who prefer menu-driven interfaces over command-line flags

1. Introduction to nmtui

1.1 What is nmtui?

nmtui (NetworkManager Text User Interface) is a curses-based terminal interface for NetworkManager. It provides a user-friendly, menu-driven alternative to the command-line nmcli tool, making network configuration accessible without memorizing commands or flags.

1.2 When to Use nmtui vs nmcli

Use nmtui when:

  • You prefer interactive menus
  • Setting up a new connection
  • Making one-time configuration changes
  • You're unfamiliar with nmcli syntax
  • Visual feedback is helpful
  • Working on a single machine interactively

Use nmcli when:

  • Scripting or automation needed
  • Remote administration via SSH
  • Batch operations on multiple connections
  • Integrating with other tools
  • Precise control over all parameters
  • Quick status checks

1.3 Installation and Requirements

# Usually pre-installed on systems with NetworkManager
# If not installed:

# Debian/Ubuntu
sudo apt-get install network-manager

# RHEL/CentOS/Fedora
sudo yum install NetworkManager-tui
# or
sudo dnf install NetworkManager-tui

# Arch Linux
sudo pacman -S networkmanager

# Verify installation
which nmtui
nmtui --version

2. Launching nmtui

2.1 Basic Launch

# Launch main menu
nmtui

# Direct access to specific functions
nmtui edit          # Go directly to Edit a connection
nmtui connect       # Go directly to Activate a connection
nmtui hostname      # Go directly to Set system hostname

2.2 Navigation Basics

Key Action
Navigate up/down through menu items
Tab Move between fields and buttons
Shift+Tab Move backwards between fields
Enter Select/activate item or button
Space Toggle checkboxes
Esc Go back/cancel
F10 or Esc Exit nmtui

3. Main Menu Overview

nmtui Main Menu

    ┌───────────────────────────────────────┐
    │                                       │
    │   Edit a connection                   │
    │   Activate a connection               │
    │   Set system hostname                 │
    │                                       │
    │   <Quit>                              │
    │                                       │
    └───────────────────────────────────────┘
            

3.1 Main Menu Options

Option Purpose Equivalent nmcli
Edit a connection Create, modify, or delete network connections nmcli connection edit
Activate a connection Enable or disable network connections nmcli connection up/down
Set system hostname Change the system's hostname nmcli general hostname

4. Editing Connections

4.1 Connection List Screen

    ┌─────────────────────────────────────────────┐
    │ Connection: Wired connection 1              │
    │             Home WiFi                       │
    │             Office VPN                      │
    │                                             │
    │ <Add>  <Edit...>  <Delete>  <Back>         │
    └─────────────────────────────────────────────┘
            

4.2 Adding a New Connection

Step-by-Step: Create New Ethernet Connection

  1. Launch nmtui: nmtui
  2. Select "Edit a connection" → Enter
  3. Navigate to <Add> button → Enter
  4. Select connection type (Ethernet, Wi-Fi, etc.) → Enter
  5. Fill in connection details (see sections below)
  6. Navigate to <OK>Enter
  7. Select <Back> to return to main menu

4.3 Connection Types

Type Use Case Common Settings
Ethernet Wired network connections IP address, gateway, DNS
Wi-Fi Wireless network connections SSID, security type, password
Bond Link aggregation (multiple interfaces) Bonding mode, slave interfaces
Bridge Network bridging (VMs, containers) Bridge interfaces
VLAN Virtual LAN tagging Parent interface, VLAN ID
VPN Virtual Private Networks VPN type, server, credentials

4.4 Ethernet Connection Configuration

    ┌────────────────────────────────────────────┐
    │ Profile name: My-Ethernet_____________     │
    │ Device: eth0___________________________    │
    │                                            │
    │ ═ ETHERNET                                 │
    │   Cloned MAC address: __________________   │
    │   MTU: __________                          │
    │                                            │
    │ ═ IPv4 CONFIGURATION  <Automatic>  ▼      │
    │   Addresses: 192.168.1.100/24________      │
    │   Gateway: 192.168.1.1_______________      │
    │   DNS servers: 8.8.8.8_______________      │
    │   Search domains: ___________________      │
    │                                            │
    │ ☐ Require IPv4 addressing                  │
    │                                            │
    │ ═ IPv6 CONFIGURATION  <Automatic>  ▼      │
    │                                            │
    │ ☑ Automatically connect                    │
    │ ☐ Available to all users                   │
    │                                            │
    │         <Cancel>        <OK>               │
    └────────────────────────────────────────────┘
            

Key Fields Explained

Field Description Example
Profile name Descriptive name for the connection Office-Ethernet, Home-Static
Device Network interface to use eth0, enp0s3, wlan0
Cloned MAC address Override hardware MAC address (optional) 00:11:22:33:44:55
MTU Maximum Transmission Unit (optional) 1500 (default), 9000 (jumbo)

4.5 IPv4 Configuration Modes

    IPv4 CONFIGURATION  <Manual>  ▼
                        ├ Disabled
                        ├ Automatic (DHCP)
                        ├ Manual (Static IP)
                        ├ Link-Local
                        └ Shared
            
Mode Description When to Use
Disabled No IPv4 addressing IPv6-only networks
Automatic DHCP client - obtain IP automatically Most home/office networks
Manual Static IP configuration Servers, network equipment
Link-Local 169.254.x.x addressing Direct device-to-device connection
Shared Share connection with other devices Internet connection sharing

4.6 Configuring Static IP Address

Setting Up Static IP

  1. Navigate to "IPv4 CONFIGURATION" dropdown
  2. Press Enter to open dropdown
  3. Select "Manual" → Enter
  4. Tab to "Addresses" field
  5. Enter: 192.168.1.100/24
  6. Tab to "Gateway" field
  7. Enter: 192.168.1.1
  8. Tab to "DNS servers" field
  9. Enter: 8.8.8.8 (press Enter for additional servers)
  10. Tab to <OK>Enter
Pro Tip: You can add multiple addresses, DNS servers, and search domains by pressing Enter after each entry to add another field.

4.7 WiFi Connection Configuration

    ┌────────────────────────────────────────────┐
    │ Profile name: Home-WiFi________________    │
    │ Device: wlan0__________________________    │
    │                                            │
    │ ═ WI-FI                                    │
    │   SSID: MyNetwork__________________        │
    │   Mode: <Client> ▼                         │
    │   BSSID: __________________________        │
    │                                            │
    │ ═ WI-FI SECURITY                           │
    │   Security: <WPA & WPA2 Personal> ▼        │
    │   Password: ************************       │
    │   ☐ Show password                          │
    │                                            │
    │ ═ IPv4 CONFIGURATION  <Automatic>  ▼      │
    │                                            │
    │ ☑ Automatically connect                    │
    │                                            │
    │         <Cancel>        <OK>               │
    └────────────────────────────────────────────┘
            

WiFi Security Types

Security Type Description Use Case
None Open network, no password Public hotspots
WEP 40/128-bit Legacy encryption (weak) Old equipment only
WPA & WPA2 Personal Password-based (PSK) Most home networks
WPA & WPA2 Enterprise RADIUS authentication Corporate networks
WPA3 Personal Latest encryption standard Modern networks

4.8 Additional Connection Options

Checkboxes at Bottom of Edit Screen

Option Effect Recommendation
Automatically connect Connect at boot/when available Enable for primary connections
Available to all users System-wide vs user-specific Enable for shared systems
Require IPv4 addressing Don't connect without IPv4 Enable for IPv4-only services
Require IPv6 addressing Don't connect without IPv6 Enable for IPv6-only services

4.9 Editing Existing Connections

Modify an Existing Connection

  1. nmtui → "Edit a connection"
  2. Select the connection to edit
  3. Navigate to <Edit...>Enter
  4. Make desired changes
  5. <OK> to save
  6. Connection will be reloaded automatically
Note: Changes take effect immediately if the connection is active. You may need to disconnect and reconnect for all changes to apply.

4.10 Deleting Connections

Remove a Connection

  1. nmtui → "Edit a connection"
  2. Select the connection to delete
  3. Navigate to <Delete>Enter
  4. Confirm deletion
Warning: Deleting a connection is permanent. The connection profile will be removed from /etc/NetworkManager/system-connections/.

5. Activating Connections

5.1 Activate a Connection Screen

    ┌────────────────────────────────────────────┐
    │ Ethernet                                   │
    │   ● Wired connection 1                     │
    │     Office-Static                          │
    │                                            │
    │ Wi-Fi                                      │
    │   ● Home-WiFi                              │
    │     CoffeeShop-Guest                       │
    │     OfficeNetwork                          │
    │                                            │
    │ VPN                                        │
    │     Corporate-VPN                          │
    │                                            │
    │                <Back>                       │
    └────────────────────────────────────────────┘
    
    ● = Active connection
            

5.2 Activating/Deactivating Connections

Enable a Connection

  1. nmtui → "Activate a connection" or nmtui connect
  2. Navigate to desired connection
  3. Press Enter to activate
  4. Active connections show ● (bullet point)
  5. Press Enter again to deactivate
Quick Tip: For WiFi networks, nmtui will scan and show available networks. Select one and enter the password when prompted.

5.3 Connection Status Indicators

Indicator Meaning
● Network Name Connection is active
  Network Name Connection is inactive
Italicized Connection is available but not configured

6. Setting System Hostname

6.1 Hostname Configuration Screen

    ┌────────────────────────────────────────────┐
    │ Set system hostname                        │
    │                                            │
    │ Hostname: myserver____________________     │
    │                                            │
    │                                            │
    │         <Cancel>        <OK>               │
    └────────────────────────────────────────────┘
            

6.2 Changing Hostname

Update System Hostname

  1. nmtui → "Set system hostname" or nmtui hostname
  2. Clear existing hostname
  3. Type new hostname
  4. Navigate to <OK>Enter
  5. Changes apply immediately
Hostname Rules:

6.3 Verifying Hostname Change

# Check current hostname
hostname

# Check all hostname info
hostnamectl status

# Alternative check
cat /etc/hostname

7. Common Configuration Scenarios

7.1 Scenario: Home DHCP Connection

Goal: Connect to home router via DHCP
  1. nmtui → Edit a connection → Add
  2. Select "Ethernet"
  3. Profile name: Home-DHCP
  4. Device: eth0
  5. IPv4 CONFIGURATION: Automatic
  6. Check "Automatically connect"
  7. OK → Back
  8. Activate a connection → Select "Home-DHCP" → Enter

7.2 Scenario: Static IP Server

Goal: Configure web server with static IP
  1. nmtui → Edit a connection → Add → Ethernet
  2. Profile name: WebServer-Static
  3. Device: eth0
  4. IPv4 CONFIGURATION: Manual
  5. Addresses: 192.168.1.50/24
  6. Gateway: 192.168.1.1
  7. DNS servers: 8.8.8.8, 8.8.4.4
  8. Check "Automatically connect"
  9. Check "Available to all users"
  10. OK → Back → Activate connection

7.3 Scenario: WiFi with Hidden SSID

Goal: Connect to hidden wireless network
  1. nmtui → Edit a connection → Add → Wi-Fi
  2. Profile name: Hidden-Network
  3. SSID: MyHiddenSSID
  4. Mode: Client
  5. Security: WPA & WPA2 Personal
  6. Password: your-password
  7. Check "Automatically connect"
  8. OK → Back → Activate connection
Hidden Network Tip: You must manually type the SSID exactly as configured on the access point.

7.4 Scenario: Secondary IP Address

Goal: Add multiple IPs to one interface
  1. nmtui → Edit a connection → Select connection → Edit
  2. Navigate to IPv4 Addresses field
  3. Enter first IP: 192.168.1.100/24
  4. Press Enter to add another field
  5. Enter second IP: 192.168.1.101/24
  6. Continue for additional IPs
  7. OK → Back → Reactivate connection

7.5 Scenario: Connection Priority

Note: nmtui doesn't directly show connection priority. The system automatically prefers:
  1. Wired over wireless
  2. Connections activated more recently
  3. Connections with lower metric values
For fine-grained priority control, use: nmcli connection modify "Name" connection.autoconnect-priority 10

8. Troubleshooting in nmtui

8.1 Connection Won't Activate

Symptom Check in nmtui Solution
No response when activating Verify device exists in Edit screen Check physical connection, driver
Activates then immediately deactivates Review IP configuration settings Check for IP conflicts, wrong gateway
WiFi not connecting Verify SSID and password spelling Re-enter credentials carefully
Multiple connections fighting Check how many are set to auto-connect Disable auto-connect on less important ones

8.2 Can't See Network Device

Diagnostic Steps:
  1. Exit nmtui
  2. Check if device exists: ip link show
  3. Check NetworkManager status: systemctl status NetworkManager
  4. Check if device is managed: nmcli device status
  5. If showing "unmanaged", check /etc/NetworkManager/NetworkManager.conf

8.3 Changes Not Saving

Issue Cause Fix
Edits disappear after OK Permission problem Run nmtui with sudo
Connection file missing Disk full or read-only Check df -h, remount rw
Settings revert Another tool managing connection Disable conflicting network managers

8.4 nmtui Performance Issues

If nmtui is slow or laggy:

9. Best Practices

9.1 Connection Naming

9.2 Configuration Guidelines

Setting Recommendation Reason
Automatically connect Enable for primary connection only Prevents conflicts
Available to all users Enable for servers/shared systems System-wide access
DNS servers Set multiple (8.8.8.8, 8.8.4.4, 1.1.1.1) Redundancy
MTU Leave default unless required Auto-negotiation works best
MAC cloning Only use when necessary Can cause network issues

9.3 Security Best Practices

Security Considerations:

9.4 Documentation Habits

Maintain Documentation:

10. nmtui vs nmcli Quick Reference

10.1 Task Comparison

Task nmtui nmcli Equivalent
Create connection Edit → Add → Fill form → OK nmcli con add type ethernet con-name "Name" ifname eth0
Edit connection Edit → Select → Edit → Modify → OK nmcli con modify "Name" ipv4.addresses "IP"
Activate connection Activate → Select → Enter nmcli con up "Name"
Deactivate connection Activate → Select active → Enter nmcli con down "Name"
Delete connection Edit → Select → Delete nmcli con delete "Name"
Set hostname Set system hostname → Enter name → OK nmcli general hostname "name"
View connection details Edit → Select → Edit (view fields) nmcli con show "Name"
List connections Edit (shows list) nmcli con show

10.2 When to Choose Which Tool

Choose nmtui for:

  • Initial setup on new systems
  • Infrequent configuration changes
  • When you can't remember nmcli syntax
  • Training new administrators
  • Visual confirmation of settings
  • Interactive connection testing

Choose nmcli for:

  • Scripting and automation
  • Remote administration
  • Batch operations
  • CI/CD pipelines
  • Quick status checks
  • Advanced features not in nmtui

11. Advanced Tips and Tricks

11.1 Keyboard Shortcuts

Shortcut Action
Ctrl+C Exit nmtui immediately (like Quit)
Ctrl+L Refresh screen (if display corrupted)
Home Jump to start of text field
End Jump to end of text field
Ctrl+A Select all text in field
Ctrl+K Delete from cursor to end of line

11.2 Quick Launch Scripts

#!/bin/bash
# Quick network configuration launcher

# Add to ~/.bashrc or ~/.bash_aliases
alias netedit='sudo nmtui edit'
alias netconn='sudo nmtui connect'
alias nethost='sudo nmtui hostname'

# Or create a wrapper
network-config() {
    case "$1" in
        edit|e)
            sudo nmtui edit
            ;;
        connect|c)
            sudo nmtui connect
            ;;
        hostname|h)
            sudo nmtui hostname
            ;;
        *)
            sudo nmtui
            ;;
    esac
}

# Usage:
# network-config edit
# network-config connect
# network-config hostname

11.3 Terminal Optimization

For Best nmtui Experience:

11.4 Backup and Restore

# Backup all NetworkManager connections
sudo tar -czf nm-backup-$(date +%Y%m%d).tar.gz \
    /etc/NetworkManager/system-connections/

# Restore connections
sudo tar -xzf nm-backup-20241025.tar.gz -C /

# Fix permissions
sudo chmod 600 /etc/NetworkManager/system-connections/*
sudo chown root:root /etc/NetworkManager/system-connections/*

# Reload in nmtui
# Just restart nmtui - it will detect changes automatically

# Or reload via command line
sudo nmcli connection reload

12. Integration with System Administration

12.1 Using nmtui in Installation Scripts

#!/bin/bash
# Post-installation network setup

# Check if NetworkManager is running
systemctl start NetworkManager
systemctl enable NetworkManager

# Launch nmtui for user configuration
echo "Please configure network settings..."
nmtui

# Verify connectivity
if ping -c 3 8.8.8.8 &>/dev/null; then
    echo "Network configured successfully"
else
    echo "Network configuration may need adjustment"
fi

12.2 Monitoring Changes

# Watch for connection file changes
inotifywait -m /etc/NetworkManager/system-connections/ -e modify -e create -e delete |
while read path action file; do
    echo "$(date): Connection $file was $action"
done

# Log nmtui usage (for auditing)
alias nmtui='logger "nmtui launched by $USER" && /usr/bin/nmtui'

13. Troubleshooting Connection Issues

13.1 Diagnostic Checklist

  1. Check if NetworkManager is running: systemctl status NetworkManager
  2. Verify device is detected: ip link show
  3. Check device is managed: nmcli device status
  4. Review connection details in nmtui Edit screen
  5. Try activating from nmtui Activate screen
  6. Check system logs: journalctl -u NetworkManager -n 50
  7. Test basic connectivity: ping 8.8.8.8
  8. Test DNS: ping google.com

13.2 Common Error Messages

Error/Symptom Likely Cause Fix
"Failed to activate connection" Wrong IP config or unavailable device Verify settings in Edit screen, check device status
Connection immediately disconnects IP conflict or authentication failure Check for duplicate IPs, verify WiFi password
Device not showing in list Driver issue or device unmanaged Check kernel messages, NetworkManager.conf
Can't save changes Permission denied Run with sudo: sudo nmtui

14. Reference: Configuration Files

14.1 Where nmtui Stores Settings

# Connection profiles (created/edited by nmtui)
/etc/NetworkManager/system-connections/

# Example connection file
/etc/NetworkManager/system-connections/Wired-connection-1.nmconnection

# NetworkManager main config
/etc/NetworkManager/NetworkManager.conf

# Check current hostname
/etc/hostname

# View connection file
sudo cat /etc/NetworkManager/system-connections/My-Connection.nmconnection

14.2 Connection File Format

[connection]
id=My-Ethernet
uuid=12345678-1234-1234-1234-123456789abc
type=ethernet
autoconnect=true
permissions=

[ethernet]
mac-address-blacklist=

[ipv4]
address1=192.168.1.100/24,192.168.1.1
dns=8.8.8.8;8.8.4.4;
dns-search=
method=manual

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

[proxy]
Note: These files are created and managed by nmtui. You can edit them manually, but using nmtui is safer and ensures proper format.

15. Summary and Quick Start

Quick Start Guide

  1. Launch: sudo nmtui
  2. Create Connection: Edit a connection → Add → Choose type → Fill details → OK
  3. Enable Connection: Activate a connection → Select → Enter
  4. Change Hostname: Set system hostname → Enter name → OK
  5. Exit: Navigate to Quit or press F10

Essential Keyboard Commands

Remember

← Back to NetworkManager Index ↑ Back to EXPANDED