Quickly identify and resolve common Linux networking issues by following clear troubleshooting steps, from checking running services to examining firewall rules. Ideal for anyone seeking to confidently diagnose unreachable services on Linux servers.
What is the very first step before beginning network troubleshooting on a Linux server when a service is unreachable?
Explanation: It is important to confirm the service or process is running first, as there is no point in debugging the network if the workload itself is down. Restarting the server is unnecessary at this stage, opening all firewall ports can be risky and unrelated, and pinging an external IP is irrelevant if the service itself is not running.
If you cannot access your service on localhost from the server itself, what is the most likely cause?
Explanation: Failure to connect to the service locally suggests it's not running or configured incorrectly. A down network interface, DNS issues, or firewall rules would not stop local access using localhost.
A web service runs on a Linux server but is only listening on 127.0.0.1. What is the result?
Explanation: Binding to 127.0.0.1 means the service is accessible only from the local machine. External clients cannot connect; the firewall and total unavailability options are unrelated to bind address settings.
Which command shows the status and IP addresses of network interfaces on a Linux server?
Explanation: 'ip addr show' displays network interface status and their assigned IP addresses. 'ping' is for connectivity checks, 'dig' queries DNS, and 'systemctl status' checks service states.
If your main network interface is down and has no IP, what command can you use to bring it up?
Explanation: 'sudo ip link set <interface> up' activates a network interface. 'ufw allow' manages firewalls, 'nslookup' queries DNS records, and 'curl' checks web service response but does not alter interface status.
Which command helps you identify the default network route used by a Linux server?
Explanation: 'ip route' shows the system's routing table and the default network path. 'ss -tulpn' lists listening ports, 'cat /etc/resolv.conf' shows DNS configuration, and 'docker ps' lists Docker containers.
If 'ping 8.8.8.8' fails from your server, what type of problem is most likely?
Explanation: A failure to reach 8.8.8.8, a public DNS server, indicates a network interface or routing issue. Application misconfiguration or a stopped service wouldn't affect low-level connectivity, and DNS is not involved with ping to an IP.
Which command can you use to verify the IP address a hostname resolves to on your server?
Explanation: 'dig example.com' returns the resolved IP for a hostname. 'ping 8.8.8.8' checks network connectivity. 'ufw status' views firewall rules, and 'systemctl restart' restarts system services.
How can you check which DNS servers your Linux system is currently using?
Explanation: 'cat /etc/resolv.conf' displays the current DNS servers. 'ss -tulpn' shows listening ports, 'ip link show' reveals interface states, and 'ufw status' checks firewall rules.
Which command helps you check if a service port is allowed through the firewall on a Linux server using UFW?
Explanation: 'sudo ufw status' reveals which ports are allowed or blocked by the firewall. 'dig' checks DNS records, 'ps aux | grep' searches processes, and 'ip route' displays routing tables.