Exercise: Managing Network Interfaces

Using nmcli and networkctl

A hands-on exercise to explore and manage network interfaces using both NetworkManager’s nmcli and systemd-networkd’s networkctl command-line tools.
Author

Chuck Nelson

Published

November 16, 2025

1 Purpose

This exercise introduces you to the command-line tools for the two major networking services on modern Linux systems: NetworkManager and systemd-networkd. Your Fedora Workstation uses NetworkManager by default, so you will use its tool, nmcli. However, it’s important to also know the commands for systemd-networkd, as it is very common in server environments. This guide provides steps for nmcli and includes callouts with the equivalent commands for systemd-networkd.

2 What You’ll Accomplish

By the end of this exercise, you will be able to:

  • Use nmcli to check the overall network status.
  • Differentiate between network “devices” and “connections” in NetworkManager.
  • Use nmcli to view devices and connection profiles.
  • Identify the equivalent networkctl commands for viewing system network state.
  • Understand why different tools are preferred for workstations versus servers.

This exercise maps to the following program and course learning outcomes:

  • Course Learning Outcomes (CLOs):
    • 3. Troubleshoot hardware and basic network components: Using nmcli or networkctl to check status is a key skill for troubleshooting network issues on any modern Linux system.

This exercise develops the following skills, which align with the O*NET SOC Code 15-1232.00 for Computer User Support Specialists.

Learning Objective O*NET KSAs Technologies Used
Manage network state using command-line tools. Knowledge: Telecommunications, Computers & Electronics
Skills: Systems Analysis, Operations Analysis
nmcli, networkctl

3 Prerequisites

This exercise requires a running Fedora 42 virtual machine with internet access and a user account with sudo privileges.

4 Step-by-Step Guide

Open a terminal window in your Fedora VM to begin.

NoteWorkstations vs. Servers: NetworkManager vs. systemd-networkd
  • NetworkManager (nmcli) is standard on workstations like Fedora. It is designed for dynamic environments where network connections change frequently (e.g., switching Wi-Fi, connecting VPNs). It’s powerful and user-friendly for desktop use.
  • systemd-networkd (networkctl) is common on servers. It uses simple text files for configuration, which is ideal for the static, predictable network setups found in data centers. It’s leaner and preferred for automation.

4.1 Step 1: Check General Status

First, get a high-level status of your networking.

  1. Run the nmcli command:

    nmcli general status
  2. This will tell you if networking is enabled overall and if your machine has a connection.

TipAlternative: Using systemd-networkd

The equivalent command for systemd-networkd is networkctl status. This command lists the status of all network links that systemd-networkd is managing.

networkctl status

4.3 Step 3: View Connections (Configuration)

Now, view the list of configured connections.

  1. Run the nmcli command:

    nmcli connection show
  2. Analyze the output. You will likely see a connection profile that corresponds to your primary Ethernet device. This highlights a key concept in NetworkManager:

    • A device (seen in Step 2) is the network interface, which can be physical hardware (like enp1s0) or a virtual interface (like a bridge, veth, or vxlan device).
    • A connection is a saved profile of settings (e.g., IP address configuration, DNS servers, Wi-Fi password) that is applied to a device.

    You can have multiple connection profiles for a single device, such as one for a static IP at the office and one for DHCP at home, and switch between them as needed.

TipAlternative: Using systemd-networkd

systemd-networkd does not have a “connection” concept. Instead, it uses simple configuration files ending in .network located in /etc/systemd/network/. You would list the configurations like this:

ls /etc/systemd/network/

This declarative, file-based approach is a key reason it’s preferred for managing servers.

4.4 Step 4: Simulate Radio Control

You can globally enable or disable different types of wireless radios.

  1. Run the following nmcli commands to simulate turning the Wi-Fi radio off and on.

    # To disable all Wi-Fi radios
    nmcli radio wifi off
    
    # Check the status of the radios
    nmcli radio
    
    # To re-enable them
    nmcli radio wifi on
    
    # Check the status again
    nmcli radio
TipAlternative: Using rfkill

systemd-networkd does not manage radios. This task is handled by a lower-level utility called rfkill.

  • rfkill list: Shows all radios, their type, and whether they are soft or hard blocked.
  • sudo rfkill block wifi: Disables all Wi-Fi radios.
  • sudo rfkill unblock wifi: Re-enables all Wi-Fi radios.

This separation of concerns is typical in server-oriented tools.

5 Reflect and Review

ImportantReflection: 3-2-1

Now that you have completed this exercise, reflect on your experience in your Microsoft Teams Student Notebook:

  • 3 different nmcli or networkctl commands you learned.
  • 2 differences between how NetworkManager and systemd-networkd operate.
  • 1 question you still have about Linux networking services.
TipCheck on Learning

Answer these questions in your notebook to solidify your understanding:

  1. What command would you use to see a list of saved network profiles in NetworkManager?
  2. Why might a server administrator prefer using systemd-networkd’s text files for configuration instead of nmcli’s connection profiles?
  3. You need to disable the Wi-Fi radio on a server that does not have NetworkManager installed. What command would you use?
  4. What networkctl command is the equivalent of nmcli device status?
Back to top