0

On the following kernel configuration path:

/proc/sys/net/ipv6/conf/

we can configure each network interface in the following way:

  • we can specify what configuration to follow for all interfaces
  • we can provide a default configuration for any new interface
  • or we can configure an interface specific configuration.

What I don't understand is what happens when the same setting is configured differently at the interface (e.g. eth0), default and all level.

For example, if we configure the accept_dad parameter to be 1 on the eth0, 2 on all and 0 on default, which value is ultimately used by OS?

Looking at the kernel documentation all they say is :

conf/default/*:
Change the interface-specific default settings.

conf/all/*:
Change all the interface-specific settings.
XXX: Other special features than forwarding?]

conf/interface/*:
Change special settings per interface.
The functional behaviour for certain settings is different depending on whether local forwarding is enabled or not.

But they don't mention anything about what is the rule if the same setting is configured at each level.

Adelin
  • 109
  • 10
  • Which Linux distro are you working with? – Itai Ganot Dec 31 '18 at 15:51
  • Indeed, this is a good question. I found another related question/answer. In fact it looks like there is no generic answer as it depends on the option how this is handled in detail. But the main part of the question should be answered here: https://unix.stackexchange.com/questions/90443/what-is-the-difference-between-all-default-and-eth-in-proc-sys-net-ipv – hargut Dec 31 '18 at 17:45

1 Answers1

1

A number of other directories exist within the /proc/sys/net/ipv4/ directory and each covers a different aspect of the network stack. The /proc/sys/net/ipv4/conf/ directory allows each system interface to be configured in different ways, including the use of default settings for unconfigured devices (in the /proc/sys/net/ipv4/conf/default/ subdirectory) and settings that override all special configurations (in the /proc/sys/net/ipv4/conf/all/ subdirectory).

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s3-proc-sys-net

Other directories within the /proc/sys/net/ipv4/ directory cover different aspects of the network stack: /proc/sys/net/ipv4/conf/ - alows you to configure each system interface in different ways, including the use of default settings for unconfigured devices and settings that override all special configurations

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/kernel_administration_guide/working_with_sysctl_and_kernel_tunables#network_interface_tunables

These are the question related sections I could find on RHEL 6 & 7 documentation. I think they are providing a better understanding when these directories are used.

It looks to be, that default is only used for newly initialized interfaces, all overrides settings for all interfaces, and interface providing interface settings not covered/set by all.

The already quoted Kernel Documentation could be a bit more clear on when which settings are used.

hargut
  • 3,908
  • 7
  • 10