1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-25 18:50:18 +03:00

network: mark container/VM/namespace networks as not required for online + disable DHCP lease persistency

These networks are not connections to upstream routers, but where we are
ourselves are the upstream router, hence it doesn't make too much sense
to require them to be up as default to determine if we are "online",
because they lead "in the wrong direction".

Also, disable DHCP lease persistency for these networks, since
container/VM/namespaces are generally shortlived, and typically have no
persistent identity. Moreover, the IP range we assign each VM/container
connection is just too small to permit persistency, as otherwise we'll
run out of leases way too quickly if VM/containers are restarted a bunch of
times with different MAC addresses (which I ran into).

I think these are better defaults, but of course these are only
defaults.
This commit is contained in:
Lennart Poettering 2025-02-07 18:08:51 +01:00 committed by Yu Watanabe
parent f90efd2d13
commit 9ccc369ff3
5 changed files with 27 additions and 0 deletions

View File

@ -14,6 +14,9 @@
Kind=veth
Name=vb-*
[Link]
RequiredForOnline=no
[Network]
KeepMaster=yes
LinkLocalAddressing=no

View File

@ -14,6 +14,9 @@
Kind=veth
Name=ve-*
[Link]
RequiredForOnline=no
[Network]
# Default to using a /28 prefix, giving up to 13 addresses per container.
Address=0.0.0.0/28
@ -24,3 +27,6 @@ LLDP=yes
EmitLLDP=customer-bridge
IPv6AcceptRA=no
IPv6SendRA=yes
[DHCPServer]
PersistLeases=no

View File

@ -13,6 +13,9 @@
Kind=bridge
Name=vz-*
[Link]
RequiredForOnline=no
[Network]
# Default to using a /24 prefix, giving up to 253 addresses per virtual network.
Address=0.0.0.0/24
@ -23,3 +26,6 @@ LLDP=yes
EmitLLDP=customer-bridge
IPv6AcceptRA=no
IPv6SendRA=yes
[DHCPServer]
PersistLeases=no

View File

@ -14,6 +14,9 @@
Kind=veth
Name=ns-*
[Link]
RequiredForOnline=no
[Network]
# Default to using a /28 prefix, giving up to 13 addresses per namespace
Address=0.0.0.0/28
@ -24,3 +27,6 @@ LLDP=yes
EmitLLDP=customer-bridge
IPv6AcceptRA=no
IPv6SendRA=yes
[DHCPServer]
PersistLeases=no

View File

@ -13,6 +13,9 @@
Kind=tun
Name=vt-*
[Link]
RequiredForOnline=no
[Network]
# Default to using a /28 prefix, giving up to 13 addresses per VM.
Address=0.0.0.0/28
@ -23,3 +26,6 @@ LLDP=yes
EmitLLDP=customer-bridge
IPv6AcceptRA=no
IPv6SendRA=yes
[DHCPServer]
PersistLeases=no