
These commands can help verify connection speeds, analyze delays, and test the reachability of other systems on Linux. Here’s an overview of several useful commands:
ping
The ping command is commonly used for basic connectivity testing. It sends “echo requests” which prompt responses. The command measures the response time and reports the percentage of requests that received replies. Response times can vary based on how many routers the signals cross and network congestion.
Example:
$ ping 192.168.0.11PING 192.168.0.11 (192.168.0.11) 56(84) bytes of data.64 bytes from 192.168.0.11: icmp_seq=1 ttl=64 time=4.36 ms...--- 192.168.0.11 ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2003ms
For remote connections, the response will take longer, and a 0% packet loss is ideal.
traceroute
The traceroute command tracks the path data takes to reach another host, measuring the time taken at each hop. It can reveal network congestion at specific routers through a timeout or asterisks if a packet fails to receive a response.
Example:
$ traceroute www.amazon.comtraceroute to www.amazon.com (99.84.218.165), 30 hops max 1 router (192.168.0.1) 1.586 ms 2 10.226.32.1 (10.226.32.1) 27.342 ms...
mtr
The mtr command is a combination of ping and traceroute, reporting on packet loss and latency between hops in real-time.
Example:
$ mtr 192.168.0.1Packets PingsHost Loss% Snt Last Avg Best Wrst StDev1. _gateway 0.0% 13 3.3 3.5 3.0 7.1 1.1
ncat
The ncat utility verifies the availability of services on particular ports without needing to execute remote commands.
Example:
$ nc -z -v 192.168.0.11 22Ncat: Connected to 192.168.0.11:22.
speedtest
The speedtest command checks your internet speed, typically highlighting differences between upload and download speeds.
Example:
$ speedtestSpeedtest by OoklaDownload: 10.34 MbpsUpload: 1.00 Mbps
nethogs
The nethogs command shows bandwidth usage by process, helping identify which applications consume the most network resources.
Example:
NetHogs version 0.8.6PID USER PROGRAM SENT RECEIVED127832 nemo /usr/lib/firefox/firefox 11.120 KB/sec 432.207 KB/sec
ss
The ss command inspects and displays socket connections on a Linux system. It provides detailed information about listening sockets and their states.
Example:
$ ss -a -tState Recv-Q Send-Q Local Address:Port Peer Address:Port ProcessLISTEN 0 4096 127.0.0.1:ipp 0.0.0.0:*
iftop
The iftop command provides a real-time view of bandwidth usage for various connections. It requires root privileges.
Example:
$ sudo iftop
ethtool
The ethtool command assesses and modifies network interface parameters, helping troubleshoot and optimize configurations.
Example:
$ ethtool --show-features wlp1s0Features for wlp1s0:tx-gso-partial: off [fixed]rx-checksumming: off [fixed]
Conclusion
These Linux commands offer various methods to assess connectivity and network performance effectively. Mastering them can provide valuable insights into network health and functionality.
Welcome to DediRock, your trusted partner in high-performance hosting solutions. At DediRock, we specialize in providing dedicated servers, VPS hosting, and cloud services tailored to meet the unique needs of businesses and individuals alike. Our mission is to deliver reliable, scalable, and secure hosting solutions that empower our clients to achieve their digital goals. With a commitment to exceptional customer support, cutting-edge technology, and robust infrastructure, DediRock stands out as a leader in the hosting industry. Join us and experience the difference that dedicated service and unwavering reliability can make for your online presence. Launch our website.