LFCA · Question #10
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…
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
How the community answered
(44 responses)- A2% (1)
- B9% (4)
- C7% (3)
- D82% (36)
Why each option
To immediately and permanently allow HTTPS access through `firewalld`, the `firewall-cmd --add-service=https --permanent --reload` command is used.
`firewallctl` is not the correct command; it should be `firewall-cmd`. Also, `--add-port` would require specifying port number and protocol, whereas `--add-service=https` uses the predefined service.
`iptables` is the older firewall utility; `firewalld` is a frontend for `netfilter` but uses its own `firewall-cmd` utility, so mixing commands is incorrect.
`firewalld --add-service=https` is incorrect syntax for the command, it should be `firewall-cmd`. Additionally, without `--permanent` and `--reload`, the rule would only be temporary and not applied immediately.
The `firewall-cmd` utility is the command-line interface for `firewalld`. `--add-service=https` adds the HTTPS service (port 443/tcp) to the current zone. `--permanent` ensures the rule persists across reboots by saving it to the configuration files. `--reload` applies the changes immediately without requiring a full firewalld restart.
Concept tested: firewalld service management (persistent rules)
Source: https://firewalld.org/documentation/man-pages/firewall-cmd.html
Topics
Community Discussion
No community discussion yet for this question.