Skip to content

Commit

Permalink
network: mark container/VM/namespace networks as not required for onl…
Browse files Browse the repository at this point in the history
…ine + 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.
  • Loading branch information
poettering authored and yuwata committed Feb 9, 2025
1 parent f90efd2 commit 9ccc369
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions network/80-container-vb.network
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
Kind=veth
Name=vb-*

[Link]
RequiredForOnline=no

[Network]
KeepMaster=yes
LinkLocalAddressing=no
Expand Down
6 changes: 6 additions & 0 deletions network/80-container-ve.network
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,3 +27,6 @@ LLDP=yes
EmitLLDP=customer-bridge
IPv6AcceptRA=no
IPv6SendRA=yes

[DHCPServer]
PersistLeases=no
6 changes: 6 additions & 0 deletions network/80-container-vz.network
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,3 +26,6 @@ LLDP=yes
EmitLLDP=customer-bridge
IPv6AcceptRA=no
IPv6SendRA=yes

[DHCPServer]
PersistLeases=no
6 changes: 6 additions & 0 deletions network/80-namespace-ns.network
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,3 +27,6 @@ LLDP=yes
EmitLLDP=customer-bridge
IPv6AcceptRA=no
IPv6SendRA=yes

[DHCPServer]
PersistLeases=no
6 changes: 6 additions & 0 deletions network/80-vm-vt.network
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,3 +26,6 @@ LLDP=yes
EmitLLDP=customer-bridge
IPv6AcceptRA=no
IPv6SendRA=yes

[DHCPServer]
PersistLeases=no

0 comments on commit 9ccc369

Please sign in to comment.