Skip to content

Commit

Permalink
Don't use dhcp4 for none mode (xapi-project#6001)
Browse files Browse the repository at this point in the history
For the context, we had an strange behavior where an host installed with
IPv6 stack only got an Ipv4 address only during the first boot due to
the start of a systemd service called chrony-wait. This is because
during the first boot the **xcp-networkd** looks for a configuration
from `/etc/firstboot.d/data/management.conf` and if the `MODE=none` it
uses DHCP4. And as chrony-wait is started it got a source in IPv4 before
XAPI had time to reconfigure it using IPv6 stack. So we think that if
the MODE is none we shouldn't use DHCP4.

Regards,
Guillaume
  • Loading branch information
psafont committed Sep 18, 2024
2 parents 9ff72f1 + d0215ed commit ba3b3ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ocaml/networkd/lib/network_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@ let read_management_conf () =
in
let dns = (nameservers, domains) in
(Static4 [(ip, prefixlen)], gateway, dns)
| "dhcp" | _ ->
| "dhcp" ->
(DHCP4, None, ([], []))
| _ ->
(None4, None, ([], []))
in

let phy_interface = {default_interface with persistent_i= true} in
let bridge_interface =
{default_interface with ipv4_conf; ipv4_gateway; persistent_i= true; dns}
Expand Down

0 comments on commit ba3b3ac

Please sign in to comment.