Hello! Welcome to the next module in your journey to becoming a proficient Linux system administrator for your web development work.
In the last module, you mastered the art of managing processes and services with systemd and journald. You learned how to check what's running on your system and how to investigate issues by reading logs. Now, we'll shift our focus from what's happening inside your Fedora machine to how it communicates with the outside world. This module, "Network Configuration and Security," is essential for deploying any web application.
Today's lesson starts with the most fundamental networking task: finding out your system's identity on the network. Before you can connect to your Django project from another computer or make it available online, you need to know its IP address.
By the end of this 60-minute lesson, you will be able to display network interface information and IP addresses using two essential command-line tools: ip and nmcli.
1. The Modern Way: The ip Command
For many years, the ifconfig command was the standard for viewing network information on Linux. However, it is now considered obsolete. Its modern, more powerful replacement is the ip command. We'll start here.
The most common way to use this command is to ask it to show your network addresses. To get a comprehensive look at your network interfaces and their assigned IP addresses, watch the first minute of this video.
030 - How To Configure Network In Linux Using NetworkManager (nmcli & nmtui) | RHEL 8
This short clip introduces the ip address show command, which is the modern replacement for the old ifconfig command, and explains the components of its output.
Watch from the beginning until 00:49. Pay attention to the command ip address show and its shorter versions, ip a s or just ip a.
As you saw, the command provides a lot of detail. Let's look at an example and break it down.

When you run ip a, you'll see a list of your network interfaces. Here’s what to look for:
- Interface Name: The entry starts with a number and the interface name (e.g.,
1: lo,2: enp0s3).lo: This is the loopback interface. It's a virtual interface that the computer uses to communicate with itself. Its IP address is almost always127.0.0.1.enp...oreth...: These are typically wired Ethernet interfaces. The naming scheme can look complex, but it's designed to be predictable based on the hardware's physical location.wlp...: These are Wireless LAN (Wi-Fi) interfaces.
- State: You'll see words like
<UP,LOWER_UP>in the description. The most important part isUP, which means the interface is enabled and active. inet: This is the IPv4 address assigned to the interface. This is the "local" IP address you'll often need for development and testing. It's usually followed by a slash and a number (e.g.,/24), which represents the subnet mask.inet6: This is the IPv6 address.
Do-It-Yourself: Find Your IP Address
Now it's your turn. Open your terminal and find your own IP address.
- Run the command. You can use the shortest alias:
ip a - Examine the output. Can you identify your main network interface? If you're connected via an Ethernet cable, it will likely be named
enp.... If you're on Wi-Fi, it will bewlp.... - Find the
inetline for that interface. What is your system's IPv4 address on your local network?
This command gives you a direct, low-level look at the current state of your network hardware.
2. The Fedora Way: NetworkManager and nmcli
While the ip command is great for viewing the current state, modern Linux distributions like Fedora use a service called NetworkManager to actively manage network settings. It handles everything from switching between Wi-Fi networks to configuring VPNs.
To interact with NetworkManager from the command line, we use nmcli (NetworkManager Command-Line Interface). This is the tool you will use most often on Fedora for both viewing and changing network configurations.
To understand the role of NetworkManager and nmcli, please read the following article. It gives an excellent high-level overview.
Get started with NetworkManager on Linux
This article from opensource.com explains what NetworkManager is, why it replaced older tools, and how nmcli is used to interact with it.
Read the sections "What NetworkManager replaces" and "How NetworkManager works". This will give you the conceptual background on why nmcli is the preferred tool on your system.
Devices vs. Connections
A key concept in NetworkManager is the distinction between a device and a connection:
- A device is the physical hardware (e.g., your Ethernet port, your Wi-Fi card). You can see these with
nmcli device. - A connection is a software profile of settings (e.g., the Wi-Fi name and password, or the static IP configuration for your office). You can see these with
nmcli connection.
A device is useless without a connection profile to tell it how to operate.
This next video provides a great demonstration of using nmcli to see both devices and connections.
Moving from network scripts to Network Manager (nmcli) | Into the Terminal 118
The hosts from Red Hat, the sponsor of Fedora, demonstrate the basic nmcli commands to view hardware devices and software connection profiles, highlighting the difference between the two.
Watch from 00:56 to 01:44. Notice the two distinct commands, nmcli dev and nmcli connection, and the different information they provide.
Do-It-Yourself: Explore with nmcli
Let's use nmcli to explore your system's network configuration.
-
List Network Devices:
See the physical hardware that NetworkManager recognizes.nmcli device statusYou can also use the short version:
nmcli d. This lists your hardware, its type, its state (connected,disconnected,unavailable), and the connection profile it's currently using. -
List Connection Profiles:
Now, see the software profiles saved on your system.nmcli connection showOr the short version:
nmcli c. This shows all the networks you've ever connected to, including your current one. The active connection will have its name listed under theDEVICEcolumn. You can also see only the active connections withnmcli connection show --active. -
Inspect Your Active Connection:
This is wherenmclibecomes very powerful. You can see every single detail about a specific connection profile. Find the name of your active connection from the previous step and use it in the command below. (If your connection name has spaces, enclose it in quotes, e.g.,"My Home WiFi").nmcli connection show <your-connection-name>This output is very long! It contains all the configuration details. You can scroll through it, but it's often more useful to search it. Since you're learning Python and working in the terminal, you'll appreciate using pipes and
grepto find exactly what you need.Try these commands, replacing
<your-connection-name>as before:- Find your IP address and gateway:
nmcli connection show <your-connection-name> | grep 'IP4.ADDRESS\|IP4.GATEWAY' - Find your DNS servers:
nmcli connection show <your-connection-name> | grep 'IP4.DNS' - Check if you are getting your IP automatically (via DHCP) or if it's set manually:
nmcli connection show <your-connection-name> | grep 'ipv4.method'automeans DHCP,manualmeans it's a static IP.
- Find your IP address and gateway:
Summary and What's Next
Great work! You now have two powerful tools to inspect your network configuration. Let's quickly recap their roles:
Key Takeaways:
ip agives you a quick, low-level view of all network interfaces and the IP addresses currently assigned to them. It's great for a fast status check.nmcliis the command-line interface for NetworkManager, the service that manages your network configurations on Fedora.nmcli deviceshows the state of your physical network hardware.nmcli connectionshows the software profiles and lets you inspect their detailed settings, like IP addresses, gateways, and DNS servers.
You've learned how to view the configuration. In our next lesson, we'll take the logical next step: you will learn how to modify a network connection using nmcli, such as setting a static IP address for your development server.