Locating the Network Information

Hands-On Lab

 

Photo of Michael Christian

Michael Christian

Course Development Director in Content

Length

00:30:00

Difficulty

Beginner

Being able to locate the IP address, netmask, gateway, DNS nameserver, and domain is critical to understanding Linux networking. In this Learning Activity, you will populate a text file with this information.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Locating the Network Information

Introduction

Being able to locate the IP address, netmask, gateway, DNS nameserver, and domain is critical to understanding Linux networking. In this hands-on lab, we're going to populate a text file with this information.

Logging In

Use the credentials provided in the hands-on lab overview page to log into the lab server with SSH.

Getting Comfortable

Once we're in, we've got to get a few pieces of information added to a network.txt file in our home directory. We're going to use an nmcli command each time. We may want to have two terminals open, one to edit the text file (with whichever text editor we want) and the other to run commands and get output.

First, let's see if NetworkManager is even running:

[cloud_user@host]$ systemctl status NetworkManager

That will show us that is it. Now let's get a list of active connections.

[cloud_user@host]$ nmcli c show

We'll see a line for eth0. That's the one we're going to be querying.

Get the Information

This is actually pretty easy. Let's run this one command:

[cloud_user@host]$ nmcli d show eth0

We need the IP address, netmask, gateway address, DNS server, and DNS domain. We can either have a terminal op

Everything we need is in that output. To get a passing grade on the lab, just get those values from the command output and get them into the proper lines of the network.txt file. Then we're done. Congratulations!