These are the tools you will reach for most often when Linux fails to connect or maintain connections over the network. Many of these tools will look familiar to those that have worked with the Microsoft Windows command line.
First is the essential ping utility. Ping is a fantastic utility in that it provides a wealth of information in an instant. If the computer is having trouble connecting to a network host you can determine right away if that host is up on the network (or if the issue is your Linux box) by entering the following:
replacing ip_address_of_host with the IP address or domain name of the host to which you are trying to connect. What ping will output is the size of the payload sent to the host and how long in milliseconds it took to receive a round trip reply, or let you know if it did not receive a reply at all.
A close cousin of ping is the trace route which uses the same ICMP protocol to send and receive packets only traceroute sends an ICMP packet to each router or 'hop' located between the host and your Linux computer. So if a ping command does not receive a reply from the host but instead receives a 'destination unreachable' message, the traceroute utility may tell you where the connection failed, sometimes revealing network errors such as loops or firewalls that are blocking the traffic. To start traceroute type the following:
replacing the domain_or_IP_Address with the name or IP address of the host to which you are trying to connect. The information displayed by traceroute includes number of hops, the IP address and/or domain name of each hop, and the round trip time in milliseconds for each hop.