Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.
04 LTS
NETWORK CONFIGURATION
TOOLS IN LINUX
Lab & Homework — Beginner Level
Ubuntu 24.04 LTS | Linux Systems Administration
المطلوب تنفيذ كل المهام و عمل صورة من
Linux Terminal
الجهاز يجب ان يكون اسم الجهاز مطابق السمك األول او العائلة
و اإلجابة على األسئلة في نهاية كل جزء من الواجب
Field Details
Lab Title Network Configuration Tools in Linux
Level Beginner
Estimated Time 75 minutes
Homework Due Next class session
Platform Ubuntu 24.04 LTS (or any modern Linux distribution)
Tools Covered ip, ifconfig, nmcli, ss, netstat, ping, traceroute, mtr
Student Name
Date
Page 1 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
1. Introduction
Every time your computer connects to the internet or a local network, Linux uses a set of built-in tools to
manage and inspect that connection. In this lab, you will learn to use five of the most important
networking tools through simple, step-by-step exercises.
By the end of this lab you will be able to view your network interfaces, check open ports, test
connectivity, and trace the path your data takes across the internet — all from the terminal.
Tool What It Does Think of it as...
ip Show and configure network interfaces and A control panel for your network card
routes
ifconfig Older tool for viewing interface information A read-only dashboard (mostly for
reading)
nmcli Manage saved network connection profiles A settings manager for Wi-Fi / Ethernet
ss / netstat Show which programs are listening on A list of open doors on your computer
which ports
ping Test whether a remote host is reachable Knocking on a door to see if anyone
answers
traceroute Show every router your data passes A breadcrumb trail across the internet
through
mtr Real-time combination of ping + traceroute A live map of your connection quality
Before You Begin — Install Required Packages
Open a terminal and run the following commands to make sure all tools are installed:
sudo apt update
sudo apt install -y net-tools iproute2 iputils-ping traceroute mtr-tiny
If a package is already installed, apt will simply skip it — that is fine.
Page 2 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
2. The ip Command — Your Network Control Panel
What is ip?
The ip command is the main tool for viewing and configuring network interfaces in Linux.
A network interface is the connection point between your computer and the network — it could
be a physical
Ethernet port (usually named eth0 or enp3s0) or a Wi-Fi card (usually wlan0 or wlp2s0).
Every interface has an IP address — the unique number that identifies your computer on the
network.
2.1 Viewing Your Network Interfaces
The most common thing you will do with ip is simply look at your current interfaces and IP addresses.
Run each command below and read the output carefully.
# See a brief summary of all interfaces
ip -br addr
# See full details of all interfaces
ip addr show
# See a specific interface (replace eth0 with your interface name)
ip addr show dev eth0
# See just the network links (no IP addresses)
ip -br link show
💡 How to read ip -br addr output
Each line shows: INTERFACE-NAME STATE IP-ADDRESS/PREFIX
Example: eth0 UP [Link]/24
• eth0 = interface name
• UP = the interface is active and connected
• [Link] = your IP address
• /24 = subnet mask (means [Link] — the first 24 bits identify your network)
The loopback interface lo with address [Link] is always present — it is used internally by the
OS.
2.2 Viewing Your Routing Table
The routing table tells Linux where to send packets depending on their destination. The most important
entry is the default route — this points to your gateway (usually your router), which forwards traffic to
the internet.
Page 3 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
# Show the routing table
ip route show
# Ask: which interface and gateway would be used to reach [Link]?
ip route get [Link]
💡 How to read ip route show output
Look for the line that starts with default — for example:
default via [Link] dev eth0 proto dhcp src [Link]
• default = this rule applies to all traffic with no more specific route
• via [Link] = send it to this gateway (your router)
• dev eth0 = using this interface
If there is no default line, your machine cannot reach the internet.
✏ Task 1: Explore Your Network Interfaces
Run each command below and write down what you observe.
• Run ip -br addr — write down the name and IP address of your main interface.
• Run ip addr show — find and write down the subnet mask (/XX number).
• Run ip route show — write down your default gateway IP address.
• Run ip route get [Link] — which interface does Linux use to reach Google DNS?
Write your answers in the space below each command result.
My main interface name: _________________________
My IP address: _________________________
My subnet mask: /________________________
My default gateway: _________________________
Interface used for [Link]: _____________________
❓ Question 1: What is the purpose of the loopback interface (lo) and its IP address
[Link]?
Answer: ____________________________________________________________
Page 4 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
3. ifconfig — The Legacy Interface Viewer
What is ifconfig?
ifconfig (interface configuration) is an older tool that does a similar job to ip addr.
It was the standard tool for many years but has been officially replaced by ip.
You will still see ifconfig used in older tutorials, scripts, and documentation — so you need to
know it.
In this lab we use ifconfig mainly for reading — not for making changes.
3.1 Basic Usage
# Show all currently active interfaces
ifconfig
# Show ALL interfaces, including inactive ones
ifconfig -a
# Show a specific interface
ifconfig eth0
💡 How to read ifconfig output
Each block of text describes one interface. Key fields to find:
• inet — your IPv4 address (e.g., inet [Link])
• netmask — the subnet mask (e.g., netmask [Link])
• broadcast — the broadcast address for your network segment
• ether — the MAC address (hardware address) of your network card
• RX packets / TX packets — how many packets were received / sent
• UP BROADCAST RUNNING — flags showing the interface is active
3.2 Comparing ifconfig and ip
Task ifconfig command ip command (modern)
Show all interfaces ifconfig -a ip -br addr show
Show one interface ifconfig eth0 ip addr show dev eth0
Show only IPv4 addresses ifconfig ip -4 addr show
Show MAC address ifconfig eth0 ip link show eth0
Show routing table route -n ip route show
✏ Task 2: ifconfig vs ip Side-by-Side
Page 5 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
Run both commands and compare their output for the same interface.
• Run ifconfig and then ip addr show — find the same IP address in both outputs.
• In ifconfig output, what field shows the subnet mask?
(Hint: look for netmask) My answer: _________________________
• In ip addr show output, how is the subnet mask written instead?
(Hint: look for /XX after the IP) My answer: _________________________
• Run ifconfig -a — do you see any interfaces that were NOT shown by ifconfig?
If yes, write their names here: _________________________
Both commands should show the same IP address — just formatted differently.
❓ Question 2: Why was ifconfig replaced by ip? Name one advantage of the ip command
over ifconfig.
Answer: ____________________________________________________________
Page 6 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
4. nmcli — Managing Network Connections
What is nmcli?
nmcli stands for NetworkManager Command Line Interface.
NetworkManager is a background service (daemon) that manages your network connections.
It saves connection profiles — named sets of settings like IP address, gateway, and DNS.
Changes made with nmcli are PERMANENT and survive a reboot, unlike changes made with ip.
nmcli is used on most Ubuntu, Fedora, and RHEL systems.
4.1 Checking Network Status
Start by understanding the current state of your network connections.
# Is NetworkManager running and connected?
nmcli general status
# List all network devices (interfaces) and their state
nmcli device status
# List all saved connection profiles
nmcli connection show
# Show only currently active connections
nmcli connection show --active
💡 Understanding nmcli device status output
Each row shows one network device. Key columns:
• DEVICE — the interface name (e.g., eth0, wlan0)
• TYPE — ethernet, wifi, loopback, etc.
• STATE — connected, disconnected, unmanaged
• CONNECTION — the name of the active connection profile (e.g., 'Wired connection 1')
An unmanaged device is one that NetworkManager is not controlling.
4.2 Viewing Connection Details
# See full details of a specific connection profile
# Replace 'Wired connection 1' with your connection name from nmcli connection
show
nmcli connection show 'Wired connection 1'
# See just the IP-related settings
nmcli connection show 'Wired connection 1' | grep ipv4
Page 7 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
# See detailed info about a device
nmcli device show eth0
4.3 Disconnecting and Reconnecting
⚠ Practice Only — Use with Care
The commands below temporarily disconnect your interface. Only run these if you are
working on a local machine (not remotely via SSH) and can reconnect physically.
# Disconnect a device (does NOT delete the profile)
sudo nmcli device disconnect eth0
# Reconnect using the saved profile
sudo nmcli device connect eth0
# Bring a connection profile up or down
sudo nmcli connection up 'Wired connection 1'
sudo nmcli connection down 'Wired connection 1'
✏ Task 3: Explore nmcli
• Run nmcli general status — is NetworkManager connected? Yes / No
• Run nmcli device status — write down all your devices and their states below:
Device Name Type State
_______________ __________ _______________
_______________ __________ _______________
_______________ __________ _______________
• Run nmcli connection show — write down the name of your active connection profile:
Active profile name: _________________________
• Run nmcli device show <your-interface> | grep IP4
What IP address does nmcli report? _________________________
Use your actual interface name (from nmcli device status) in place of <your-interface>.
❓ Question 3: What is the difference between nmcli device disconnect and sudo ip link set
eth0 down? Which change is permanent?
Answer: ____________________________________________________________
Page 8 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
9. Quick Reference Cheat Sheet
Keep this page handy during the lab and when doing your homework.
9.1 ip Commands
What you want to do Command to run
See all interfaces and IPs (brief) ip -br addr
See full IP details ip addr show
See only the routing table ip route show
Find which interface reaches a host ip route get [Link]
See MAC addresses and link state ip -br link show
See interface statistics (packets) ip -s link show eth0
9.2 ifconfig Commands
What you want to do Command to run
See all active interfaces ifconfig
See ALL interfaces ifconfig -a
See one specific interface ifconfig eth0
9.3 nmcli Commands
What you want to do Command to run
Check overall network status nmcli general status
List all devices and states nmcli device status
List all connection profiles nmcli connection show
See IP info for a connection profile nmcli connection show 'My Connection' | grep
ipv4
See all info about a device nmcli device show eth0
9.4 ss / netstat Commands
What you want to do Command to run
See all listening TCP ports + processes sudo ss -tlnp
See all listening UDP ports + processes sudo ss -ulnp
Check a specific port (e.g., 22) sudo ss -tlnp sport = :22
See socket count summary ss -s
Page 9 of 10
Network Configuration Tools | Lab & Homework | Beginner Level | Ubuntu 24.04 LTS
Legacy: see all open ports netstat -tlnup
Legacy: see routing table netstat -rn
9.5 ping / traceroute / mtr Commands
What you want to do Command to run
Test if a host is reachable (5 packets) ping -c 5 [Link]
Ping a hostname ping -c 5 [Link]
Trace the path (numeric, no DNS) traceroute -n [Link]
Trace with hostnames traceroute [Link]
Live path analysis (press q to quit) mtr [Link]
mtr report — 30 cycles then stop mtr -r -n -c 30 [Link]
Save mtr report to a file mtr -r -n -c 30 [Link] > [Link]
Lab Complete! Great work making it through.
You have now used all five network tool categories. Before you leave:
• Make sure all six Task answer boxes are filled in.
• Make sure all eight Question boxes have an answer written.
• Start your Homework — the mtr report for HW3 takes a couple of minutes to run.
• Bring any questions about your mtr results to the next class for discussion.
Page 10 of 10