diff --git a/rocky-9/data/files/nm-eth0.conf b/rocky-9/data/files/nm-eth0.conf new file mode 100644 index 0000000..a873fb5 --- /dev/null +++ b/rocky-9/data/files/nm-eth0.conf @@ -0,0 +1,4 @@ +[connection-eth0] +match-device=interface-name:eth0 +ipv4.route-metric=0 +ipv6.route-metric=0 diff --git a/rocky-9/data/init.ks.pkrtpl.hcl b/rocky-9/data/init.ks.pkrtpl.hcl index af3dac2..df1d592 100644 --- a/rocky-9/data/init.ks.pkrtpl.hcl +++ b/rocky-9/data/init.ks.pkrtpl.hcl @@ -166,6 +166,11 @@ ${files_hcloud_ssh_keys_service} EOF systemctl enable hcloud-ssh-keys.service + +cat >/etc/NetworkManager/conf.d/eth0.conf <<\EOF +${files_hcloud_nm_eth0} +EOF +chmod 644 /etc/NetworkManager/conf.d/eth0.conf %end ### Reboot after the installation is complete. diff --git a/rocky-9/server.pkr.hcl b/rocky-9/server.pkr.hcl index a0c33a7..a345327 100644 --- a/rocky-9/server.pkr.hcl +++ b/rocky-9/server.pkr.hcl @@ -20,6 +20,7 @@ locals { files_hetznercloud_default_init = file("${abspath(path.root)}/data/files/90-hetznercloud.cfg") files_hetznercloud_ds_init = file("${abspath(path.root)}/data/files/92-hetznercloud-ds.cfg") files_hetznercloud_init = file("${abspath(path.root)}/data/files/93-hetznercloud.cfg") + files_hcloud_nm_eth0 = file("${abspath(path.root)}/data/files/nm-eth0.conf") }) build_id = "${uuidv4()}" build_labels = {