LFCA · Question #10
LFCA Question #10: Real Exam Question with Answer & Explanation
The correct answer is D: firewall-cmd --add-service=https --permanent --reload. To immediately and permanently allow HTTPS access through firewalld, the firewall-cmd --add-service=https --permanent --reload command is used.
Question
When working on a Linux system with firewalld enabled, how can other systems be allowed to access the HTTPS port on the system in the default firewall zone so that the access is granted immediately and persists across reboots?
Options
- Afirewallctl --add-port=https --reload
- Biptables --add-service=https --permanent
- Cfirewalld --add-service=https
- Dfirewall-cmd --add-service=https --permanent --reload
Explanation
To immediately and permanently allow HTTPS access through firewalld, the firewall-cmd --add-service=https --permanent --reload command is used.
Common mistakes.
- A.
firewallctlis not the correct command; it should befirewall-cmd. Also,--add-portwould require specifying port number and protocol, whereas--add-service=httpsuses the predefined service. - B.
iptablesis the older firewall utility;firewalldis a frontend fornetfilterbut uses its ownfirewall-cmdutility, so mixing commands is incorrect. - C.
firewalld --add-service=httpsis incorrect syntax for the command, it should befirewall-cmd. Additionally, without--permanentand--reload, the rule would only be temporary and not applied immediately.
Concept tested. firewalld service management (persistent rules)
Reference. https://firewalld.org/documentation/man-pages/firewall-cmd.html
Topics
Community Discussion
No community discussion yet for this question.