Sample question 1 — Operate running systems
A web application on a RHEL 9 host listens on port 8080, but clients on the corporate network cannot reach it. The administrator has confirmed that the application process is running and wants the firewall to permit that port in the active zone, with the change surviving a reboot of the server. Which command should the administrator run?
- A. Run firewall-cmd --permanent --add-port=8080/tcp followed by firewall-cmd --reload.
- B. Run firewall-cmd --add-service=http so the default HTTP port replaces the custom listener.
- C. Run iptables -F to clear every rule so the application port becomes reachable.
- D. Run setenforce 0 to relax the host policy so the firewall rule can be applied.
Answer: A. Option A is correct because firewall-cmd --permanent --add-port=8080/tcp records the port in the persistent zone configuration and the following firewall-cmd --reload loads it into the running ruleset. Option B is wrong because the http service maps to port 80, not the 8080 listener this application uses. Option C is wrong because flushing every iptables rule drops all filtering and does not persist a specific allowance. Option D is wrong because SELinux enforcement controls process access, not the packet filter that is blocking the clients.
