Reverse Path Filtering Is Not a Substitute for Routing Policy

rp_filter is often added to a host-hardening checklist as if it were a single yes-or-no protection. Linux exposes different modes, and the correct value depends on routing. Strict reverse-path filtering can drop traffic on a host with asymmetric routing, while loose mode can allow more traffic than the team expects. A change that improves spoof resistance in one network can break a legitimate path in another.

The Linux IP sysctl documentation describes reverse-path checks that validate an incoming source address against the routing table. It also documents settings where the mark is included in the reverse-path lookup, which matters for policy routing and transparent proxy designs. The effective result is a property of the interface, the namespace, and the route selection used for that packet.

Understand the policy before choosing the mode

Strict filtering is appropriate when the routing model makes the return path unambiguous. Loose filtering can be a better fit where multiple interfaces or policy rules provide legitimate paths, but it weakens the claim that a source address arrived on the expected interface. A host with VRFs, multipath routing, NAT, or container networking may need an explicit design rather than a copied sysctl value.

The all-interface default and per-interface settings interact. Do not infer the effective value from one file. Check the namespace where the traffic is processed, the interface that receives it, and the route lookup that the kernel performs. Record exceptions with a reason and an expiry date so they do not become permanent undocumented bypasses.

Test with real source addresses

A curl test from a neighboring host verifies authentication and reachability, not which interface received the packet. Use packet captures and the relevant route and rule tables to confirm the source, destination, and ingress interface. Test a deliberately invalid source address from an approved lab environment, then confirm that the expected drop occurs without affecting production paths.

For containers and virtual machines, verify each network namespace. The host may enforce one policy while a container has a different default or a route that bypasses the host check. A service mesh or load balancer can also rewrite addresses before the packet reaches the workload, changing the evidence available at the endpoint.

Combine controls

Reverse-path filtering is a useful anti-spoofing control, but it does not replace an ingress ACL, a firewall policy, authenticated routing, or network segmentation. It cannot prove that an authorized source is benign. It can also create an availability incident if a route changes during a failover exercise while the filter remains fixed.

Keep a tested rollback for every change and monitor interface counters during rollout. A drop counter that rises only after a policy change is evidence worth investigating before the change is accepted.

Limits

The kernel's routing decision is not a threat model. A workstation with broad routes may still accept spoofed traffic, and a host with several legitimate paths may need a carve-out. The useful control is the documented relationship between a source address, an ingress interface, and a route. Without that relationship, the sysctl is a number, not a security boundary.

References