sysctl.conf, net.ipv4.conf.default.forwarding, race condition?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
procps (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: procps
/etc/sysctl.conf contains the following lines by default:
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.
In my system, uncommenting the line _usually_ does the trick: IPv4 forwarding is enabled on all network interfaces. Unfortunately, this was not the case every time. Sometimes, once in 10 reboots or so, this did not work. IPv4 forwarding was not enabled on some network interfaces.
I am not 100 % sure why this happens, but I think it might be caused if sometimes a network interface gets initialised before sysctl sets the above setting. Thus, I tried to define the following _two_ settings in /etc/sysctl.conf:
net.ipv4.
net.ipv4.
(I think the first setting tells what happens to the new interfaces that are created after setting the sysctl, and the second setting tells what happens to the interfaces that have already been created?)
Now everything has worked fine for months. Every time IPv4 forwarding gets enabled properly.
I have two physical network interfaces, "eth0" and "eth1", both of which use the "e100" driver.
lspci:
02:02.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 08)
02:08.0 Ethernet controller: Intel Corporation 82801DB PRO/100 VE (LOM) Ethernet Controller (rev 82)
Hi.
Thank you for your report.
Do you still use this system where you were having problems? If so, can you check if you're using upstart or sysvinit?
try running /sbin/init --version and see if it's upstart or else.
Also, was that interface using DHCP or static addresses?
Usually, at least for upstart, rcS is run before networking scripts, but this needs further testing I guess. I'll see if I can reproduce it myself.