5

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?

  • cat /proc/sys/net/ipv6/conf/all/disable_ipv6 1 that soesn't sound like IPv6 is activated – Kiwy Mar 13 '14 at 8:24
  • 2
    @Kiwy Isn't that the point of the question? It's about what happens when things are disabled in /all but enabled for individual interfaces – Michael Mrozek Mar 13 '14 at 17:06
2
  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.

2

Interesting, i had a similar issue wrapping my head around the forwarding parameter.

In IPv4 you can forward on some interfaces. That is useful especially on multihomed hosts where you want to keep some of the subnets on internal interfaces really private. You can also activate forwarding for all interfaces by using .../all/forwarding and you can define a default value to be set for any interface coming up later. That's all ok but ...

In IPv6 this behavior is indeed different. I'd set the forwarding=1 for some of my IPv6 interfaces without setting ../all/forwarding=1 and was surprised that no forwarding happened at all. The kernel param manual says the following:

11.2.3.5. forwarding

Type: BOOLEAN

Default: FALSE if global forwarding is disabled (default), otherwise TRUE

Configure interface-specific Host/Router behaviour. Note: It is recommended to have the same setting on all interfaces; mixed router/host scenarios are rather uncommon. [...]

So setting /proc/sys/net/ipv6/conf/all/forwarding=1 is mandatory to get it working, and that sounds logical because the host can be either only a router (No router soliciations, router advs & redirects are ignored) or just a plain host (accepting router advs & autoconf) but not both at the same time or at least can't behave different on a selection of interfaces that makes the difference to IPv4

Although the term all is very confusing here and should be replaced by enabled because once you set that on IPv6 you can clear forwarding on one or more of the other interfaces to be excluded from forwarding! So the condition for all isn't met anymore. Now i would expect that if you clear one of them then all gets cleared too? ... but to my surprise that's not the case!

The Question seems to be if all overrides any of the other forwarding settings then

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

can't be true at the same time when all is mandatory, from my point of view it's simply a contradiction!

  • That's at least some information on the forwarding parameter. I suppose one of these days I will just have to try it out. – Bananguin Oct 2 '16 at 18:23
  • conf/all/forwarding can be better understood as 1 = enabled 2 = disabled – L.R. Dec 1 '17 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.