Linux – Kernel /proc ipv6 settings precedence

ipv6linux-kernelproc

I'm about to connect our network to the IPv6 Internet and need to control the kernel ipv6 settings found under /proc. I know there are configurations for each interface, for all interfaces, and the default config. My question is: which settings win if the individual values contradict each other? While I was able to find good documentation on the individual settings, I don't know about setting precedence …

There is a related question concerning IPv4, but it mainly talks about the differences of all, default and the individual interfaces. From that I gather the concrete settings are always somehow logically combined. However, the fields most important to me (see the following examples) are not covered, and IPv6 seems to be implemented differently so that the referenced kernel source file in the referenced answer does not help my IPv6 issue and the following examples.

A few examples:

cat /proc/sys/net/ipv6/conf/all/accept_ra
0
cat /proc/sys/net/ipv6/conf/eth1/accept_ra
1

Will eth1 accept router advertisements?

cat /proc/sys/net/ipv6/conf/all/forwarding
1
cat /proc/sys/net/ipv6/conf/eth1/forwarding
0
cat /proc/sys/net/ipv6/conf/eth1/accept_ra
1

Will eth1 accept router advertisements?

cat /proc/sys/net/ipv6/conf/all/disable_ipv6
1
cat /proc/sys/net/ipv6/conf/all/accept_ra
1
cat /proc/sys/net/ipv6/conf/eth1/disable_ipv6
0
cat /proc/sys/net/ipv6/conf/all/accept_ra
0

Will eth1 accept router advertisements?

cat /proc/sys/net/ipv6/conf/all/disable_ipv6
1
cat /proc/sys/net/ipv6/conf/all/fowarding
1
cat /proc/sys/net/ipv6/conf/eth1/disable_ipv6
0
cat /proc/sys/net/ipv6/conf/all/accept_ra
1

Will eth1 accept router advertisements?

Best Answer

  1. yes
  2. yes
  3. depends
  4. depends

The "default" entries are, well, the default. When an interface comes up, it inherits the parameters from there.

The "all" entries are there to assign a parameter to all interfaces at once. That does not mean that every interface is locked to that parameter. For instance, consider

echo 0 > /proc/sys/net/ipv6/conf/all/accept_ra
echo 1 > /proc/sys/net/ipv6/conf/enp2s1/accept_ra

then

cat /proc/sys/net/ipv6/conf/all/accept_ra
0
cat /proc/sys/net/ipv6/conf/enp2s1/accept_ra
1
cat /proc/sys/net/ipv6/conf/wlp2s0/accept_ra
0

so "all" does not represent any kind of state, it is only for collective assignment.

Related Question