Welcome to Day 10 of the 30 Days of Linux Challenge. Today’s focus is on a set of essential tools that every Linux administrator, DevOps engineer, and infrastructure professional relies on: network troubleshooting and diagnostics.

Whether you're debugging DNS failures, checking if a web service is reachable, or trying to find out why a server won’t connect — these tools help you understand what’s really happening on the network level.

And today, we’re doing it all on Red Hat Linux (RHEL/CentOS/AlmaLinux/Rocky).

📚 Table of Contents

Why Network Diagnostics Matter

If your application is running but unreachable, it's likely not the application — it's the network.

Learning to troubleshoot connectivity issues is a must for:

  • Debugging SSH connection errors
  • Testing web server availability
  • Identifying DNS or firewall issues
  • Confirming if ports are open
  • Understanding routing or latency problems

These tools work even when you're logged into a headless server, over SSH, or during a production fire.

Core Network Troubleshooting Tools

🔹 ping – Check Host Reachability

ping google.com
ping -c 4 8.8.8.8
Tests basic network reachability

Image description

Helps determine if DNS is working or not

-c lets you limit the number of packets sent

If ping 8.8.8.8 works but ping google.com doesn’t, you likely have a DNS issue.

hostname – View System Identity

hostname
hostname -I
Shows system hostname and assigned IP addresses

Image description

Use hostnamectl to modify hostnames on RHEL

ip – Network Configuration (Replacement for ifconfig)

ip a # Show IP addresses
ip r # Show routing table
ip link # Show interfaces and MAC addresses

Modern, powerful, and default in Red Hat. Helps you inspect interfaces and routes.

ss – Socket Statistics (Replaces netstat)

ss -tuln
ss -s
t = TCP, u = UDP, l = listening, n = numeric

Useful to confirm whether your application is actually listening on a port

Image description

Example: check if SSH is running on port 22

ss -tuln | grep :22

traceroute – Trace Network Hops

traceroute google.com
Visualizes the path your packets take to reach a host

Helps locate latency or routing issues

Image description

Not installed by default:

sudo dnf install traceroute

dig and nslookup – DNS Resolution

dig google.com
nslookup google.com

See how names resolve to IPs

Identify DNS server behavior

Not installed by default:

sudo dnf install bind-utils

nmap – Network Port Scanner

nmap localhost
nmap -Pn 192.168.1.1
Check what ports are open on a system

Image description

Useful for firewall, security, and service audits

Install it via:

sudo dnf install nmap

Common Use Cases

Scenario :: Tool(s) Used
Test if internet is reachable :: ping, dig
DNS name fails to resolve :: dig, nslookup
Confirm IP address of the host :: hostname -I, ip a
Check if a service is running and listening :: ss -tuln, nmap
Identify latency or network delay :: ping, traceroute
Inspect local routing :: ip r

Try It Yourself

Test your system’s network setup with this mini lab:

  • ping -c 3 google.com
  • ip a
  • ss -tuln
  • sudo dnf install nmap -y
  • nmap localhost
  • dig github.com
  • traceroute github.com

Try scanning your own ports or checking if Apache/Nginx/SSH is properly listening.

Why This Matters

  • Mastering these commands means you can:
  • Quickly isolate connectivity issues
  • Understand how servers interact
  • Verify DNS, IP, ports, and services
  • Avoid costly downtime from misconfigured networks

For Red Hat admins working in enterprise or cloud environments, these tools are vital for uptime and security.