chiark / gitweb /
sysctl.d: enable promote_secondaries by default
authorTom Gundersen <teg@jklm.no>
Fri, 25 Jul 2014 09:08:23 +0000 (11:08 +0200)
committerTom Gundersen <teg@jklm.no>
Fri, 25 Jul 2014 09:18:12 +0000 (11:18 +0200)
Without this, secondary addresses would get deleted when the primary one is. This is not
the desired behavior when one would like to transition from one address to another in the
same subnet (such as when a new IP address is given over DHCP).

In networkd, when given a new IP over DHCP we will add it, without explicitly removing the
old one first (and hence never have a window without an IP address configured). Assuming the
addresses are in the same subnet, that means that the old address is the primary and the new
address is the secondary one. Once the old address expires, the kernel will drop it. With the
old behavior this means that both addresses would be lost, which is clearly not what we want.
With the new behavior, only the old address is lost, and the new one is promoted to primary.

Reported by Michael Olbrich <m.olbrich@pengutronix.de>

sysctl.d/50-default.conf

index 46bae210c76de85821e73fb2ac3563d210d0bcb3..1ee3698ca6b3514fe8e665986db02aaa19e46fd8 100644 (file)
@@ -19,6 +19,9 @@ net.ipv4.conf.default.rp_filter = 1
 # Do not accept source routing
 net.ipv4.conf.default.accept_source_route = 0
 
+# Promote secondary addresses when the primary address is removed
+net.ipv4.conf.default.promote_secondaries = 1
+
 # Enable hard and soft link protection
 fs.protected_hardlinks = 1
 fs.protected_symlinks = 1