These commands can display all the firewall rules applied to the Linux servers, depending on which firewall service is being used.
The firewall-cmd command is a utility for managing firewalld, which is a dynamic firewall service that supports zones and services. The --list-all option will show all the settings and rules for the default zone, or for a specific zone if specified. For example, firewall-cmd --list-all --zone=public will show the rules for the public zone1.
The ufw command is a frontend for iptables, which is a low-level tool for manipulating netfilter, the Linux kernel’s packet filtering framework. The status option will show the status of ufw and the active rules, or the numbered rules if verbose is specified. For example, ufw status verbose will show the numbered rules and other information2.
The other options are incorrect because:
A. ufw limit
This command will limit the connection attempts to a service or port using iptables’ recent module. It does not display any firewall rules2.
B. iptables -F
This command will flush (delete) all the rules in the selected chain, or all chains if none is given. It does not display any firewall rules3.
C. systemctl status firewalld
This command will show the status of the firewalld service, including whether it is active or not, but it does not show the firewall rules4.
F. iptables -A
This command will append one or more rules to the end of the selected chain. It does not display any firewall rules3.