A system administrator needs to verify the active firewall rules on a Linux server to ensure compliance with the company's security policies. Which of the following commands provides the most comprehensive output of the currently active firewall rules?
The command iptables -L -v -n is the correct answer as it displays all the active rules in all chains with verbose output and does not resolve hostnames (due to the -n flag), which can be helpful in speeding up the process. It is more comprehensive compared to just listing the rules without additional verbosity, the numeric option preserves exact network addresses and port numbers, and the combination of these flags gives the admin a detailed perspective on the rules. iptables -S simply lists the rules in a format that can be reused as input to the firewall, and the --state flag is not a valid iptables option, leading to a command error. firewall-cmd --list-all only works with systems using firewalld and is therefore not guaranteed to work on all Linux distributions.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are the different options in the command 'iptables -L -v -n'?
Open an interactive chat with Bash
What other commands can I use to manage firewall rules in Linux?
Open an interactive chat with Bash
What are the consequences of not checking active firewall rules?