Score:1

How to set /proc/sys/net/ipv6/conf/all/forwarding to 1 by default in network namespaces?

it flag

By default, when I create a network namespace, I get:

/proc/sys/net/ipv6/conf/all/forwarding=0

Even if it is 1 in my root network namespace or in /etc/sysctl.conf. I was wondering where network namespaces get the default config and how to change that. I'd like to have that set to 1 so that new network namespaces get that config by default.

Score:2
it flag

I thikn I found the answer. In general, network namespaces inherit the parameters of the root namespace. This is controlled by devconf-inherit-init-net settings as explained here: https://www.kernel.org/doc/html/latest/admin-guide/sysctl/net.html#devconf-inherit-init-net

By default all ipv4 parameters are inherited but not ipv6

Michael Hampton avatar
cz flag
Nice find. The default does make some sense. Most of the time containers will configure IPv6 very differently to the host, and starting with the default configuration is reasonable in this scenario. By contrast inheriting IPv4 configuration has been done for so long that most everyone expects it to happen, and changing that to not inherit would confuse people and break existing applications in unforeseen ways. And Linus always says to never break userspace....
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.