DevOps / Sys Admin Q & A #14 : Is my server down?
Is client or server?
The first troubleshooting step is to check the client link. In other words, we need to verify that our client's connection to the network is working.
To see what interface we use, run /sbin/ifconfig command to list all the available network interfaces and their settings:
$ ifconfig eth0 Link encap:Ethernet HWaddr 06:26:bf:cb:78:43 inet addr:172.31.12.19 Bcast:172.31.15.255 Mask:255.255.240.0
The second line of output tells us our host has an IP address ( 172.31.12.19 ) and subnet mask ( 255.255.240.0 ) configured. Check whether these are the correct settings for this host.
If the interface is not configured, we need to run to see if the interface comes up:
$ sudo ifup eth0 $ ifconfig
If the settings are wrong or the interface won't come up, we may want to inspect /etc/network/interfaces on Ubuntu system.
Now we can check if the Ethernet device (NIC) is physically connected to the network using ethtool:
$ sudo ethtool eth0 Settings for eth0: Link detected: yes
As we can see from the output, Link detected is set to yes , so our machine we can connect from is physically connected to the network.
Once we confirmed the interface is up and we're hooked up to network, the next step is to see if a default gateway has been set and whether we can access it.
We'll use route command with -n flag to prevent from mapping ip to hostname:
$ sudo route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 172.31.0.1 0.0.0.0 UG 0 0 0 eth0 172.31.0.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
The line we're interested in is the first line, which starts with default (0.0.0.0). Here we can see that the host has a gateway of 172.31.0.1.
$ ping -c 3 172.31.0.1 PING 172.31.0.1 (172.31.0.1) 56(84) bytes of data. 64 bytes from 172.31.0.1: icmp_seq=1 ttl=64 time=0.747 ms 64 bytes from 172.31.0.1: icmp_seq=2 ttl=64 time=0.533 ms 64 bytes from 172.31.0.1: icmp_seq=3 ttl=64 time=0.563 ms --- 172.31.0.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1999ms rtt min/avg/max/mdev = 0.533/0.614/0.747/0.096 ms
As we can see we were able to successfully ping the gateway, which means that we can at least communicate with the 172.31.0.1 network.
Now that we're sure we can speak to the gateway, the next thing to test is whether DNS is functioning properly. We can use either dnslookup or dig to troubleshoot potential DNS issues.
DNS will be discussed in a separate article.
The next steps are described in DevOps / Sys Admin Q & A (13) - Is my web site down?
DevOps
DevOps / Sys Admin Q & A
Linux - system, cmds & shell
- Linux Tips - links, vmstats, rsync
- Linux Tips 2 - ctrl a, curl r, tail -f, umask
- Linux - bash I
- Linux - bash II
- Linux - Uncompressing 7z file
- Linux - sed I (substitution: sed 's///', sed -i)
- Linux - sed II (file spacing, numbering, text conversion and substitution)
- Linux - sed III (selective printing of certain lines, selective definition of certain lines)
- Linux - 7 File types : Regular, Directory, Block file, Character device file, Pipe file, Symbolic link file, and Socket file
- Linux shell programming - introduction
- Linux shell programming - variables and functions (readonly, unset, and functions)
- Linux shell programming - special shell variables
- Linux shell programming : arrays - three different ways of declaring arrays & looping with $*/$@
- Linux shell programming : operations on array
- Linux shell programming : variables & commands substitution
- Linux shell programming : metacharacters & quotes
- Linux shell programming : input/output redirection & here document
- Linux shell programming : loop control - for, while, break, and break n
- Linux shell programming : string
- Linux shell programming : for-loop
- Linux shell programming : if/elif/else/fi
- Linux shell programming : Test
- Managing User Account - useradd, usermod, and userdel
- Linux Secure Shell (SSH) I : key generation, private key and public key
- Linux Secure Shell (SSH) II : ssh-agent & scp
- Linux Secure Shell (SSH) III : SSH Tunnel as Proxy - Dynamic Port Forwarding (SOCKS Proxy)
- Linux Secure Shell (SSH) IV : Local port forwarding (outgoing ssh tunnel)
- Linux Secure Shell (SSH) V : Reverse SSH Tunnel (remote port forwarding / incoming ssh tunnel) /)
- Linux Processes and Signals
- Linux Drivers 1
- tcpdump
- Linux Debugging using gdb
- Embedded Systems Programming I - Introduction
- Embedded Systems Programming II - gcc ARM Toolchain and Simple Code on Ubuntu/Fedora
- LXC (Linux Container) Install and Run
- Linux IPTables
- Hadoop - 1. Setting up on Ubuntu for Single-Node Cluster
- Hadoop - 2. Runing on Ubuntu for Single-Node Cluster
- ownCloud 7 install
- Ubuntu 14.04 guest on Mac OSX host using VirtualBox I
- Ubuntu 14.04 guest on Mac OSX host using VirtualBox II
- Windows 8 guest on Mac OSX host using VirtualBox I
- Ubuntu Package Management System (apt-get vs dpkg)
- RPM Packaging
- How to Make a Self-Signed SSL Certificate
- Linux Q & A
- DevOps / Sys Admin questions
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization