A Linux administrator is testing a web application on a laboratory service and needs to temporarily allow DNS and HTTP/HTTPS traffic from the internal network. Which of the following commands will accomplish this task?
Comprehensive and Detailed Explanation From Exact Extract:
The correct way to temporarily allow specific services in a particular zone with firewalld is to use firewall-cmd --add-service=service --zone=zone. Multiple services can be specified in curly braces and separated by commas. The correct syntax is:
bash
CopyEdit
firewall-cmd --add-service={dns,http,https} --zone=internal
This command will allow DNS (port 53), HTTP (port 80), and HTTPS (port 443) through the firewall for the 'internal' zone temporarily (for the current runtime session).
Other options:
A . The command syntax is incorrect; firewalld is a service, not a command-line tool.
B . iptables does not use the --enable-service flag, nor does it have zones in this way.
D . systemctl mask disables services, and the rest of the command is invalid.
CompTIA Linux+ Study Guide: Exam XK0-006, Sybex, Chapter 9: 'Networking', Section: 'Managing Firewalls with firewalld'
CompTIA Linux+ XK0-006 Objectives, Domain 2.0: Networking
===========
Currently there are no comments in this discussion, be the first to comment!