Step 1 — Basic Connectivity Test
>_BASH
$# Test internet connectivity$ping -c 10 8.8.8.8$$# Test DNS resolution$nslookup google.com$$# Test a specific port$nc -zv google.com 443Step 2 — Trace the Network Path
>_BASH
$# Traceroute (shows each hop)$traceroute 8.8.8.8$$# MTR (combines ping + traceroute)$apt-get install -y mtr$mtr --report 8.8.8.8Sample MTR output:
HOST: my-server Loss% Snt Last Avg Best Wrst StDev
1. 10.0.0.1 0.0% 10 0.5 0.5 0.4 0.6 0.1
2. 203.0.113.1 0.0% 10 1.2 1.3 1.1 1.5 0.1
3. ??? 100.0% 10 0.0 0.0 0.0 0.0 0.0
A hop showing 100% loss but subsequent hops working is normal (ICMP filtering).
Step 3 — Check Network Interface
>_BASH
$# Interface statistics$ip -s link show eth0$$# Check for errors$ethtool -S eth0 | grep -i error$$# Check routing table$ip route showStep 4 — Bandwidth Testing
>_BASH
$# Install iperf3$apt-get install -y iperf3$$# On server B (receiver)$iperf3 -s$$# On server A (sender)$iperf3 -c <SERVER_B_IP> -t 30Expected results:
- Same region, private network: 10+ Gbps
- Same region, public network: 1–5 Gbps
- Cross-region: 100–500 Mbps
Step 5 — Check Firewall Rules
>_BASH
$# List iptables rules$iptables -L -n -v$$# Check if traffic is being dropped$iptables -L -n -v | grep DROPStep 6 — DNS Issues
>_BASH
$# Check DNS servers$cat /etc/resolv.conf$$# Test DNS resolution speed$time nslookup google.com$$# Use a different DNS server$nslookup google.com 1.1.1.1Common Issues and Fixes
| Issue | Symptom | Fix |
|---|---|---|
| Firewall blocking | Connection refused | Add firewall rule |
| MTU mismatch | Large packets dropped | Set MTU to 1450 |
| DNS failure | Cannot resolve hostnames | Fix /etc/resolv.conf |
| Routing issue | Partial connectivity | Check ip route |
