Network Diagnostics
beginnernetworkbashdiagnosticstroubleshooting
Create a comprehensive network diagnostic toolkit to understand connectivity concepts
← Back to BeginnerLearning Objectives
- Understand core networking concepts: IP addressing, DNS, routing
- Learn to troubleshoot network connectivity issues
- Develop skills in network performance analysis
- Interpret diagnostic tool outputs
- Create reusable network troubleshooting scripts
Requirements
You are required to write a script network-diagnostics.sh that accepts a hostname or IP address and performs comprehensive network diagnostics:
- Connection Testing
- Validate input format (hostname or IP)
- Perform ICMP ping test with configurable count and packet size
- Report packet loss percentage and RTT statistics (min/avg/max)
- Test connection to common ports (80, 443, 22)
- Routing Analysis
- Run traceroute to the target
- Count number of hops to destination
- Calculate latency per hop
- Detect routing anomalies (timeouts, high latency hops)
- DNS Investigation
- Forward and reverse DNS lookups
- Query record types: A, AAAA, MX, TXT, CNAME
- Check DNS resolution speed
- Display TTL values
- Network Information
- Display local network configuration
- Show active interfaces and their status
- Display routing table
- List established connections related to target
- Reporting
- Formatted, timestamped report
- Summary section with pass/fail indicators
- Save results to a structured log file
- Recommend potential solutions for identified issues
Stretch Goals
- Add TLS/SSL certificate verification for HTTPS endpoints
- Implement parallel testing for faster results
- Add MTU discovery and path MTU testing
- Create ASCII visualizations of test results
Deliverables
network-diagnostics.shscript- Sample outputs for different test scenarios
- Documentation covering usage, result interpretation, and troubleshooting recommendations
References
- Linux Networking Commands
- DNS Concepts - Cloudflare
- Understanding traceroute
- Network Troubleshooting - Red Hat
- Netcat Guide - DigitalOcean
Once you complete this task you will know how to use command-line tools to diagnose network issues and interpret their outputs - crucial skills for operating distributed systems where network problems are the most common failure point.
Submit Your Solution
Completed this project? Share your solution with the community!
- Push your code to a GitHub repository
- Open an issue on our GitHub repo with your solution link
- Share on X with the hashtag #DevOpsDiary
