LightYear
/Docs
DocsTroubleshootingDiagnose Network Connectivity Issues

Diagnose Network Connectivity Issues

Use ping, traceroute, and netstat to diagnose network connectivity problems on your server.

intermediate
8 min read
LightYear Docs Team
Updated April 24, 2026
networkingpingtraceroutenetstattroubleshooting
Ready to get started?

Network connectivity issues can manifest as slow responses, packet loss, or complete connection failures. This guide covers the essential diagnostic tools.

Step 1 — Test Basic Connectivity

>_BASH
$ping -c 4 8.8.8.8
OUTPUT
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=1.23 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=1.19 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=118 time=1.21 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=118 time=1.18 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.18/1.20/1.23/0.018 ms

If ping fails, the issue is at the network level (firewall, routing, or the server's network interface).

Step 2 — Trace the Network Path

>_BASH
$traceroute 8.8.8.8
OUTPUT
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  gateway (10.0.0.1)  0.456 ms  0.423 ms  0.412 ms
 2  203.0.113.1 (203.0.113.1)  1.234 ms  1.198 ms  1.187 ms
 3  * * *
 4  8.8.8.8 (8.8.8.8)  1.567 ms  1.543 ms  1.521 ms

* * * at a hop means that router does not respond to ICMP — this is normal and not necessarily an error.

Step 3 — Check DNS Resolution

>_BASH
$dig google.com A +short
OUTPUT
142.250.x.x

If DNS fails:

>_BASH
$cat /etc/resolv.conf
OUTPUT
nameserver 8.8.8.8
nameserver 8.8.4.4

If /etc/resolv.conf is empty or missing, add DNS servers:

>_BASH
$echo "nameserver 8.8.8.8" > /etc/resolv.conf
$echo "nameserver 1.1.1.1" >> /etc/resolv.conf

Step 4 — Check Listening Ports

>_BASH
$ss -tulnp
OUTPUT
Netid  State   Recv-Q  Send-Q  Local Address:Port  Peer Address:Port  Process
tcp    LISTEN  0       128     0.0.0.0:22           0.0.0.0:*          sshd
tcp    LISTEN  0       511     0.0.0.0:80           0.0.0.0:*          nginx
tcp    LISTEN  0       511     0.0.0.0:443          0.0.0.0:*          nginx
tcp    LISTEN  0       70      127.0.0.1:3306       0.0.0.0:*          mysqld

Step 5 — Check Active Connections

>_BASH
$ss -tnp | grep ESTABLISHED

Step 6 — Test a Specific Port

>_BASH
$nc -zv YOUR_SERVER_IP 443
OUTPUT
Connection to 45.77.x.x 443 port [tcp/https] succeeded!

Step 7 — Check Bandwidth Usage

>_BASH
$apt install -y nethogs
$nethogs eth0

nethogs shows per-process bandwidth usage in real time, helping identify processes consuming excessive bandwidth.

[!NOTE] If you suspect a DDoS attack, check your LightYear control panel for traffic graphs and consider enabling DDoS protection or using a CDN to absorb traffic.

Was this article helpful?

Your cookie choices for this website

This site uses cookies and related technologies, as described in our privacy policy, for purposes that may include site operation, analytics, and enhanced user experience. You may choose to consent to our use of these technologies, or manage your own preferences. Cookie policy