9 Tips to diagnose remote GNU/Linux server network connectivity issues
Many new admin or Linux users get frustrated when their remote Linux box is not accessible dues to network connectivity.
In this article I will try to provide tools and information about how to diagnose network configurations. You can try these tips/tools to diagnose an issue of Linux network connectivity to remote or local servers.
Steps to diagnose the problem:
#1: Use ping command
Always ping the IP address of server and then try hostname. For example:
$ ping 75.126.43.232
$ ping cyberciti.biz
If you can ping by IP address but not by hostname, then make sure you have correct DNS name servers setup in /etc/resolv.conf file.
$ less /etc/resolv.conf
Output:
nameserver 192.168.1.10 nameserver 208.67.222.222 nameserver 208.67.220.220
Make sure your own DNS server running.
#2: Use traceroute command
If you cannot ping your server at all, use traceroute to trace network problem. traceroute provides the detailed information about path to a network server. You can always find out if server is down from your own workstation or gateway router.
$ traceroute cyberciti.biz
#3: Look for default route / gateway IP
If traceroute point out that you cannot reach to your own gateway, then check routing setting on your own workstation. Add default route.
# route
# route add default gw 192.168.1.254 eth0
#4: Look for IP address
Make sure you have correct IP address assigned by DHCP server. Some time network admin make changes to DHCP server or changes IP routing or other stuff. It is a good idea to restart network interface:
# /etc/init.d/network restart
# tail -f /var/log/message
# ifconfig -a
# route
#5: Check for network cables and power supply
Make sure the network cable is plugged into interface as well as into network switch/hub. It is possible that someone may have pulled out network cable from switch/workstation.
#6: Check firewall log
Make sure your own firewall is not blocking access to remote server. Just try to stop your firewall.
# iptables -L -n
# tail -f /var/log/messages
# /etc/init.d/iptables stop
If you are using Cisco PIX or dedicated Linux / OpenBSD box as firewall, check logs for more information.
#7: Connect to correct ports
Most service connects to default port such as
HTTP - port 80
Proxy - port 3128
SSH - port 22
FTP - port 21
Sometime you change default ports to increase security, so make sure you are connecting to correct remote port.
#8 Network analysis
Besides above tools you must use network analysis tools such as Wireshark aka Ethereal sniffer, netwatch, tcpdump and others. These tools are commonly known as a network protocol analyzer. They can watch routing, client and server communication, packets and much more.
Install Wireshark.
# apt-get install wireshark
$ sudo wireshark &
For detailed usage please refer to official documentation
tcpdump
tcpdump is one my favorite tool. For example to print all packets arriving at router, use:
# tcpdump host router
Read man page of tcpdump for more examples and usage. I recommend you to read tcpdump recipes for more information.
If all of the above test fails contact remote IDC staff. Remote server may be down due any one of the following causes:
- Remote network/gateway down (traceroute will tell this)
- Your server is down (cable is not plugged or power is down or hardware failure etc)
- Your server is under heavy load (Slashdotted or dugg to death)
- Your server is under attack ( DoS/DDoS )
- Your server is rooted (read as cracked or hacked)
- Misconfiguration (server software - firewall, apache, mysql config issues)
#9: Some common question (FAQ)
I can ping a server by its ip address, but I can not "ping" it by name
Setup correct nameserver
I can connect to a Web or FTP server directly, but if I “ping” the server it always returns “Request Timed Out”
Many net/server admins block ICMP ping request as a security measure. So it is not possible to use ping or traceroute command. However you can try out tcptraceroute to bypass the firewall filters policy to run traceroute.
Can I use GUI tools?
You can use cheops - a network monitor tools for same purpose. It’s a combination of a variety of network tools to provide system administrators and users with a simple interface to managing and accessing their networks. Install cheops with apt-get command:
# apt-get install cheops
$ sudo cheops &

Now just add your domains and hosts. You can select any of your host by right clicking and run ping, traceroute, DNS lookup etc.
You can also use mtr for finding out a bad or simply overloaded network link with Linux/UNIX oses.
Please note that you can use these tools to diagnose any operating system such as Sun Solaris or Microsoft Window server
That's all my brain can remember. Feel free to share any other tips in the comments.
Updated for accuracy.
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- Finding out a bad or simply overloaded network link with Linux/UNIX oses
- Best Linux / UNIX Posts of 2007: Part ~ III
- Linux/UNIX: sharing a CUPS printer queue
- Fedora core installing package groups with yum
- How do I Monitor a slow UNIX or Linux system?
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!




Also check the arp table… Good for finding out if the problem is fw related, layer2, or layer 3.
Sean
Great article. Sure this will help a bunch of people. Keep up the great work on the site. Have it in liferea.
“arping” command is sometimes useful, too (mainly for local problems).
http://www.bitwizard.nl/mtr/
When you’re at #5 you might have a serial console to access (ok that’s lokal network debugging then) the system and ask mii-tool for informations. Sometimes that’s a fast option to check if someone pluged off the network cable or the port on the patch panel is dead etc. pp.
Don’t forget that tcptraceroute can also help diagnose if there is a transparent proxy between your and your server. mii-tool doesn’t work with all network cards, ethtool seems to work with everything at this point.
99% time the cause of network connection problems are environmental and IDC staff, stemming from someone inadvertantly pulling out a network cable.
[...] apresenta informações e ferramentas para diagnosticar as configurações de rede… [ link ] Powered by Gregarious [...]
In case you want some details on how to change the default port for SSH on your server, making it a little more secure, check out the writeup at:
http://timarcher.com/?q=node/46
please send me linux networking command
Great article. Can you suggest any other resources? I have a server I’ve setup with Fedora7 and it keeps going offline seemingly randomly. None of the items you mentioned appear to be the issue.
Here are suspicious logs, but I’m not sure what this means:
Sep 12 08:26:40 localhost kernel: NETDEV WATCHDOG: eth0: transmit timed out
Sep 12 08:26:40 localhost kernel: sky2 eth0: tx timeout
Sep 12 08:26:40 localhost kernel: sky2 eth0: disabling interface
Sep 12 08:26:40 localhost kernel: sky2 eth0: enabling interface
Sep 12 08:26:40 localhost kernel: sky2 eth0: ram buffer 0K
Sep 12 08:26:43 localhost kernel: sky2 eth0: Link is up at 1000 Mbps, full duplex, flow control both
Yeah, this was a nice article to refer to.
thanks you much.