Exercise: Exploring Network Interfaces and Basic Connectivity

Using Command-Line Tools

A hands-on exercise to identify network interfaces, check IP configuration, and test network connectivity using fundamental Linux command-line tools.
Author

Chuck Nelson

Published

November 13, 2025

1 Purpose

This exercise provides your first hands-on experience with command-line networking tools in a Linux environment. Before you can diagnose complex network problems, you must be able to verify the status of your own machine’s network connection. This exercise walks you through the fundamental commands to inspect your network interfaces, check your IP address, and test connectivity to other devices on the network and the internet.

2 What You’ll Accomplish

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

  • Use ip addr to identify network interfaces and their IP addresses.
  • Use ip route to find your default gateway.
  • Use ping to test connectivity to your router and to a public internet server.
  • Install the mtr tool and use it to map the path to a destination.

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

  • Program Learning Outcomes (PLOs):
    • 3. Apply terminology and numeric or system concepts: You will use commands that display and require understanding of IP addresses, interfaces, and network routes.
  • Course Learning Outcomes (CLOs):
    • 3. Troubleshoot hardware and basic network components: Identifying your IP address and testing connectivity are the first steps in any network troubleshooting process.

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
Identify local network configuration in Linux. Knowledge: Telecommunications, Computers & Electronics
Abilities: Information Ordering
ip, ping
Test connectivity to local and remote hosts. Knowledge: Telecommunications
Skills: Troubleshooting, Systems Analysis
mtr

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.

4.1 Step 1: List Network Interfaces

The ip addr command (or ip a for short) is used to show all network interfaces on your system and their configuration.

  1. Run the command:

    ip addr
  2. Analyze the output. You will see at least two interfaces:

    • lo: The loopback interface, which always has the IP address 127.0.0.1. This is used for the system to talk to itself.
    • A second interface, likely named enp1s0 or similar. This is your primary Ethernet adapter. Find the inet line under this interface to see your IPv4 address.

In your student notebook, write down the name of your primary network interface and its IPv4 address.

4.2 Step 2: Find Your Default Gateway

The default gateway is your router, the device that connects you to other networks. You can find its address using the ip route command.

  1. Run the command:

    ip route
  2. Look for the line that starts with default via. The IP address listed on this line is the address of your router.

In your notebook, write down the IP address of your default gateway.

4.3 Step 3: Test Local Connectivity

Now you will use the ping command to see if you can communicate with your default gateway.

  1. Run ping using the gateway address you found in the previous step. The -c 4 flag tells ping to send 4 packets and then stop.

    # Replace 192.168.1.1 with your gateway address
    ping -c 4 192.168.1.1
  2. If successful, you will see four replies from the gateway. This confirms your local network connection is working.

CautionIs ping a reliable test?

ping is an excellent first step, but it is not 100% reliable for determining if a host is online. Many firewalls are configured to silently drop ping requests as a basic security measure.

If a ping fails, it could mean the host is offline, or it could simply mean that a firewall is blocking the request. A successful ping proves a host is up, but an unsuccessful ping is not definitive proof that a host is down.

4.4 Step 4: Test Internet Connectivity

Next, test if you can reach a server on the public internet. We’ll use 8.8.8.8, which is a reliable public DNS server run by Google.

  1. Run the ping command again, this time to the public IP:

    ping -c 4 8.8.8.8
  2. Successful replies here confirm that your router is correctly configured and you have a live internet connection.

4.5 Step 5: Install and Use mtr

The mtr command (My Traceroute) is a modern network diagnostic tool that combines the functionality of ping and traceroute into a single, more advanced utility. It may not be installed by default.

  1. Install the mtr package using dnf:

    sudo dnf install -y mtr
  2. Run mtr to 8.8.8.8. We will use the --report flag, which sends 10 packets to each hop and generates a single report, similar to the classic traceroute command.

    mtr --report 8.8.8.8
  3. Analyze the output. By default, mtr will try to look up the hostname for each IP address, which can be slow. The first hop should be your default gateway. Each subsequent line is another router your traffic passes through. mtr also provides useful statistics like packet loss (Loss%) and average latency (Avg) for each hop.

  4. To speed up the test or to see only IP addresses, use the --no-dns (or -n) flag. Run this command now:

    mtr --report --no-dns 8.8.8.8

In your notebook, write down the IP address of the first two hops in the output from your last command.

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 key pieces of network information you can find using the ip command.
  • 2 different destinations you tested with ping and what each result told you.
  • 1 question you still have about the output of mtr.
TipCheck on Learning

Answer these questions in your notebook to solidify your understanding:

  1. What command would you use to find your computer’s IP address in Linux?
  2. You run ip addr and see your IP address is 169.254.50.100. What does this likely mean?
  3. You can successfully ping your default gateway, but you get “Destination Host Unreachable” when you try to ping 8.8.8.8. Where is the problem most likely located?
  4. What is the purpose of the mtr command?
Back to top