Skip to content

Practice Exercise: Network Connectivity Troubleshooting with Ping and Traceroute

Introduction

In this lab, you will assume the role of a junior system administrator tasked with testing and troubleshooting network connectivity using the ping and traceroute commands on a Linux system. These commands are essential for diagnosing network issues and understanding the path data takes over the internet. This lab will guide you through the steps to effectively use these tools for network troubleshooting.

Prerequisites

  • Basic knowledge of Linux command line
  • A Linux system with internet access

Lab Scenario

As a junior system administrator, you need to ensure that your Linux system can establish connections to various online servers available on the internet. Your goal is to learn how to use the ping and traceroute commands to check network connectivity and troubleshoot any issues that may arise.

Tasks

Task 1: Ping a Well-Known Server

  • Use the ping command to check connectivity to a well-known server (e.g., google.com).
  • ping google.com
  • Analyze the output, including response times and packet loss.

Task 2: Ping by IP Address

  • Use ping to check connectivity to a server by its IP address (e.g., 8.8.8.8).
  • ping 8.8.8.8
  • Observe the responses and identify any differences compared to using domain names.

Task 3: Ping with Different Packet Sizes

  • Experiment with different packet sizes using the -s flag with ping.
  • ping -s 100 google.com
  • Observe how packet size affects response times and packet loss.

Task 4: Continuous Ping

  • Use ping with the -c flag to send a continuous ping to a server.
  • ping -c 10 google.com
  • Interrupt the ping with Ctrl+C and analyze the statistics.

Task 5: Traceroute to a Server

  • Use the traceroute command to trace the route to a well-known server (e.g., yahoo.com).
  • traceroute yahoo.com
  • Analyze the output to see the path and hop-by-hop latency.

Task 6: Traceroute with ICMP

  • Perform a traceroute using ICMP packets with the -I flag.
  • traceroute -I yahoo.com
  • Compare the results with the default UDP traceroute.

Task 7: Traceroute with Specific Port

  • Use traceroute to trace the route to a server on a specific port (e.g., port 80 for HTTP).
  • traceroute -p 80 yahoo.com
  • Understand how different ports can be used for traceroute.

Task 8: Traceroute with Maximum Hops

  • Set a maximum number of hops using the -m flag with traceroute.
  • traceroute -m 20 yahoo.com
  • Observe how this affects the traceroute path.

Task 9: Troubleshooting High Latency

  • Perform a ping to a server with known high latency (e.g., a server in a distant location).
  • Analyze the results and understand the impact of latency on network performance.

Task 10: Troubleshooting Packet Loss (Optional)

  • Simulate packet loss by blocking ICMP packets on your firewall or router.
  • Use ping to detect and troubleshoot packet loss.

Sample Troubleshooting Command

  • Simulate packet loss by blocking ICMP packets on your firewall or router, and then use ping to detect and troubleshoot the issue.

These exercises will help you become proficient in using the ping and traceroute commands to troubleshoot network connectivity issues on your Linux system.