A systems administrator deploys a new web server on a Linux machine. The service starts correctly, and the administrator confirms it is accessible from the server itself by running curl http://127.0.0.1/. However, connection attempts from other clients on the same local network fail. The administrator verifies that ping from a client to the server's IP address is successful and that the web service is listening on 0.0.0.0:80. Which of the following commands is the most effective next step to diagnose the issue on the server?
The correct answer is to use iptables -L INPUT -v -n. Given the scenario, the web service is running and accessible locally, and basic network connectivity is confirmed via ping. This strongly suggests that a firewall is blocking incoming traffic to port 80 from external sources. The iptables -L INPUT -v -n command is the most direct way to investigate this by listing the rules for the INPUT chain in a verbose and numeric format, which would quickly show if a rule is dropping or rejecting TCP packets destined for port 80.
systemctl restart httpd is incorrect because the service is already confirmed to be running and working locally. Restarting it is unlikely to solve a network access problem.
route -n is incorrect because successful pings indicate that layer 3 routing between the client and server is working correctly.
getenforce is incorrect because while SELinux could potentially cause such an issue, the symptoms are a classic example of a network firewall misconfiguration. The firewall is the first and most probable component to check.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the `iptables` command used for in Linux?
Open an interactive chat with Bash
Why does `iptables` use INPUT chains, and what do they control?
Open an interactive chat with Bash
How does `iptables` differ from SELinux in troubleshooting network issues?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Troubleshooting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access