2

In Debian 13 "Trixie," the system comes with some sysctl defaults in /usr/lib/sysctl.d/50-default. Here is a snippet:

# Source route verification
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.*.rp_filter = 2
-net.ipv4.conf.all.rp_filter

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.*.accept_source_route = 0
-net.ipv4.conf.all.accept_source_route

# Promote secondary addresses when the primary address is removed
net.ipv4.conf.default.promote_secondaries = 1
net.ipv4.conf.*.promote_secondaries = 1
-net.ipv4.conf.all.promote_secondaries

My understanding is that net.ipv4.conf.*.... sets a parameter on all existing interfaces, net.ipv4.conf.default.... sets the default value for interfaces created in the future, and net.ipv4.conf.all.... sets the parameter on existing and future interfaces.

In the snippet above, the minuses in the -net.ipv4.conf.all.... lines exclude them from the globbing in the net.ipv4.conf.*.... lines. What is the purpose of doing that, when it seems all current and future interfaces would be covered by the globs and default values anyway?

1 Answer 1

2

There’s a difference in precedence between .default., explicit interfaces, and .all.. .default. sets the default for future interfaces, but it’s only a default: interface-specific values are preferred to the default. .all. on the other hand sets a minimum for all interfaces which can’t be reduced for a specific interface.

The purpose of the sysctl snippet is to configure all current interfaces and set the default. Setting the default first ensures that devices adding during the wildcard enumeration are handled; using the wildcard ensures that device that already existed are handled. Skipping .all. allows specific interfaces to have a different value set.

See this systemd commit for reference.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.