RHCSA RHCSA Firewalld and Network Configuration 2 — Questions and Answers
Question 1: Which command makes firewalld configuration changes survive a system reboot?
- firewall-cmd --reload
- firewall-cmd --permanent followed by --reload (Correct answer)
- systemctl restart firewalld
- firewall-cmd --save
Correct answer: firewall-cmd --permanent followed by --reload
Using --permanent saves the rule to disk; --reload applies the saved config so it is active immediately and persists after reboot.
Question 2: You need to allow TCP port 8443 only on the 'internal' zone. Which command is correct?
- firewall-cmd --zone=internal --add-port=8443/tcp --permanent (Correct answer)
- firewall-cmd --add-port=8443/tcp --permanent
- firewall-cmd --zone=internal --open-port=8443 --permanent
- firewall-cmd --zone=internal --add-service=8443 --permanent
Correct answer: firewall-cmd --zone=internal --add-port=8443/tcp --permanent
The --zone flag targets a specific zone; --add-port=8443/tcp specifies port and protocol.
Question 3: What is the default behavior of the 'drop' zone in firewalld?
- Rejects all traffic with an ICMP error
- Silently drops all incoming traffic with no response (Correct answer)
- Accepts all traffic from trusted sources only
- Forwards all traffic to the default zone
Correct answer: Silently drops all incoming traffic with no response
The drop zone discards all incoming packets without sending any rejection message back to the sender.
Question 4: Which nmcli command assigns the IP address 192.168.1.50/24 to connection 'eth0'?
- nmcli con mod eth0 ipv4.addresses 192.168.1.50/24 (Correct answer)
- nmcli con set eth0 ip4 192.168.1.50/24
- nmcli dev mod eth0 ipv4.addr 192.168.1.50/24
- nmcli con add eth0 ipv4.addresses 192.168.1.50/24
Correct answer: nmcli con mod eth0 ipv4.addresses 192.168.1.50/24
nmcli con mod modifies an existing connection; ipv4.addresses sets the static IP with prefix.
Question 5: After modifying a NetworkManager connection with nmcli, which command activates the new settings?
- nmcli con reload
- nmcli con up <connection-name> (Correct answer)
- systemctl restart network
- ip link set <dev> up
Correct answer: nmcli con up <connection-name>
nmcli con up brings the connection down and back up, applying any modified parameters.
Question 6: Which file would you edit to set a static hostname permanently on RHEL 9?
- /etc/sysconfig/network
- /etc/hostname (Correct answer)
- /proc/sys/kernel/hostname
- /etc/hosts
Correct answer: /etc/hostname
/etc/hostname contains the system's static hostname and is read at boot by systemd.
Question 7: What does the command 'firewall-cmd --list-all' display?
- All zones and their configurations
- The active zone with its current services, ports, and rules (Correct answer)
- Only the services allowed in all zones
- The firewalld daemon version and status
Correct answer: The active zone with its current services, ports, and rules
--list-all shows the full configuration of the currently active (default) zone including services, ports, interfaces, and sources.
Which command makes firewalld configuration changes survive a system reboot?