202-450 practice question 23 of 25

When the default policy for the netfilter INPUT chain is set to DROP, why should a rule allowing traffic to localhost exist?

Full set: 119 questions
Answer options
A: All traffic to localhost must always be allowed
B: It doesn’t matter; netfilter never affects packets addressed to localhost
C: Some applications use the localhost interface to communicate with other applications Correct answer
D: syslogd receives messages on localhost
E: The iptables command communicates with the netfilter management daemon netfilterd on localhost to create and change packet filter rules
Correct Answer:
C. Some applications use the localhost interface to communicate with other applications
Explanation

The localhost (or loopback) interface is a virtual network interface used by the system to communicate with itself. Many applications and services, such as databases, web servers, and X11, use this interface for inter-process communication (IPC) by binding to the 127.0.0.1 address. If the default INPUT policy is DROP, all incoming packets are blocked, including these essential local communications. Therefore, an explicit rule to ACCEPT traffic on the loopback interface (-i lo) is necessary to ensure the proper functioning of local services and applications on the system.

Why Incorrect

A. This is too absolute. While generally true for functionality, specific security hardening might restrict some localhost traffic, though it is uncommon and complex.
B. This is factually incorrect. The netfilter framework processes all packets in the Linux kernel's network stack, including those on the loopback interface.
D. This is just one specific example of the general principle described in option C. Option C is the more comprehensive and fundamental reason.
E. The iptables command interacts with the netfilter kernel modules via a setsockopt system call, not through a daemon named netfilterd.

References

1. Debian Administration, "Securing your server with iptables," Section: The Loopback device. The guide states, "The loopback device is used for internal communication... Many applications expect to be able to communicate with 'localhost' and will fail if they cannot." (https://www.debian.org/doc/manuals/securing-debian-manual/ch-sec-services.en.html#s-firewall-setup-iptables)

2. Red Hat Enterprise Linux 7 Documentation, "9.5. USING IP TABLES," Section: Basic Concepts of iptables. The documentation explains that rules are needed for all traffic, and implicitly, this includes loopback if the default policy is DROP.

3. Arch Linux Wiki, "iptables," Section: "Setting up a simple stateful firewall." The example ruleset explicitly includes iptables -A INPUT -i lo -j ACCEPT with the comment "Allow all loopback traffic". (https://wiki.archlinux.org/title/iptables)

Scroll to Top