-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting a static IP on Fedora 36 fails, uses DHCP instead #12762
Comments
I'm also experiencing a this but in MicroOS (#12777). In the case of MicroOS there's no way of installing a working version of From what I understood, Vagrant lets the VM OS configure the interface (using dhcp) before trying to set a the static address. I naively tried this, but it didn't work as expected (vagrant also tries to use
Since the dhcp server is there anyway, couldn't we just use it to assign our "static" IP? And perhaps even set the hostname? |
Vagrant's static IP configuration of guest machines is broken, so this is a hack to fix it during initial provision
Install the NetworkManager-initscripts-ifcfg-rh as suggested by hashicorp/vagrant#12762
The root cause of the problems is that vagrant doesn't support NetworkManager which is used in Fedora 36 hashicorp/vagrant#12762. So, the private_network we define in the Vagrantfile gets setup on the host but not in the guest. We fix this by using vagrant_dev_provision_eth1 (set the interface ourselves). But, this provisioner runs after the sync_folder(s) are created. So, the synced_folders fail when using nfs because networking isn't setup right. There is no way to run a provisioner before a synced_folder, hashicorp/vagrant#936. So, we must set `disabled: true`, bring the vm up, set `disabled: false`, and reload the vm. In addition, git introduced checking of owners for directories git/git@8959555. In the NFS case the UID/GID from the host likely doesn't match the UID/GID of the user in the vm. This causes git to complain. So, we need to set safe.directory to '*'. This configuration is set inside of the vm and we only have one user inside of vms so it is safe.
* Fix #350: Fix nfs mounts for fedora 36. The root cause of the problems is that vagrant doesn't support NetworkManager which is used in Fedora 36 hashicorp/vagrant#12762. So, the private_network we define in the Vagrantfile gets setup on the host but not in the guest. We fix this by using vagrant_dev_provision_eth1 (set the interface ourselves). But, this provisioner runs after the sync_folder(s) are created. So, the synced_folders fail when using nfs because networking isn't setup right. There is no way to run a provisioner before a synced_folder, hashicorp/vagrant#936. So, we must set `disabled: true`, bring the vm up, set `disabled: false`, and reload the vm. In addition, git introduced checking of owners for directories git/git@8959555. In the NFS case the UID/GID from the host likely doesn't match the UID/GID of the user in the vm. This causes git to complain. So, we need to set safe.directory to '*'. This configuration is set inside of the vm and we only have one user inside of vms so it is safe.
Having same issue. I've found out that recently Fedora deprecated usage of
which works perfectly for me. Here's note left in
|
If someone needs ad-hoc workaround, you can add following provisioner for your VM: config.vm.provision "shell", inline: <<-SHELL
nmcli conn modify 'Wired connection 2' ipv4.addresses $(cat /etc/sysconfig/network-scripts/ifcfg-eth1 | grep IPADDR | cut -d "=" -f2)
nmcli conn modify 'Wired connection 2' ipv4.method manual
service NetworkManager restart
SHELL This is likely to break when using more interfaces than just one for private network. |
Vagrant isn't able to properly configure modern Fedora images [1], so handle network configuration for eth1 in the provisioning playbook. [1]: hashicorp/vagrant#12762
Vagrant isn't able to properly configure modern Fedora images [1], so handle network configuration for eth1 in the provisioning playbook. [1]: hashicorp/vagrant#12762
Vagrant isn't able to properly configure modern Fedora images [1], so handle network configuration for eth1 in the provisioning playbook. [1]: hashicorp/vagrant#12762
Vagrant isn't able to properly configure modern Fedora images [1], so handle network configuration for eth1 in the provisioning playbook. [1]: hashicorp/vagrant#12762
Vagrant isn't able to properly configure modern Fedora images [1], so handle network configuration for eth1 in the provisioning playbook. [1]: hashicorp/vagrant#12762
Vagrant isn't able to properly configure modern Fedora images [1], so handle network configuration for eth1 in the provisioning playbook. [1]: hashicorp/vagrant#12762
Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it.
Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it.
* tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
* tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
* Convert exoscale tf provider to new version (#10646) This is untested. It passes terraform validate to un-broke the CI. * specify pyyaml version to 5.3.1 Signed-off-by: bo.jiang <[email protected]> * Migrate CI_BUILD_ID to CI_JOB_ID and CI_BUILD_REF to CI_COMMIT_SHA (#10063) * Use supported version of fedora in CI (#10108) * tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: bo.jiang <[email protected]> Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> Co-authored-by: Max Gautier <[email protected]> Co-authored-by: Florian Ruynat <[email protected]> Co-authored-by: Arthur Outhenin-Chalandre <[email protected]>
* tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
* tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
* tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
* tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
* [kubernetes] Add hashes for kubernetes 1.26.11, 1.26.10 Make kubernetes 1.26.11 default * Workaround for yaml/pyyaml#601 * Convert exoscale tf provider to new version (#10646) This is untested. It passes terraform validate to un-broke the CI. * Update 0040-verify-settings.yml (#10699) remove embedded template * Use supported version of fedora in CI (#10108) * tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> Co-authored-by: piwinkler <[email protected]> Co-authored-by: Arthur Outhenin-Chalandre <[email protected]>
* tests: replace fedora35 with fedora37 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: replace fedora36 with fedora38 Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * docs: update fedora version in docs Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * molecule: upgrade fedora version Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * tests: upgrade fedora images for vagrant and kubevirt Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * vagrant: workaround to fix private network ip address in fedora Fedora stop supporting syconfig network script so we added a workaround here hashicorp/vagrant#12762 (comment) to fix it. * netowrkmanager: do not configure dns if using systemd-resolved We should not configure dns if we point to systemd-resolved. Systemd-resolved is using NetworkManager to infer the upstream DNS server so if we set NetworkManager to 127.0.0.53 it will prevent systemd-resolved to get the correct network DNS server. Thus if we are in this case we just don't set this setting. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * image-builder: update centos7 image Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> * gitlab-ci: mark fedora packet jobs as allow failure Fedora networking is still broken on Packet, let's mark it as allow failure for now. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]> --------- Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
doing this as hashicorp/vagrant#12762 mentioned that Fedora 36 and later doesn't use ifconfig-rh anymore which is why we're getting dhcp addreses
Starting with version 36 Fedora stopped supporting
ifcfg
files by default. Support can be restored by installing theNetworkManager-initscripts-ifcfg-rh
package, but depending on the scenario this might not be possible. You can see this in the debug output:NetworkManager managed systems should use keyfiles instead.
Vagrant version
Vagrant 2.2.19
Host operating system
Fedora 35
Guest operating system
Fedora 36
Vagrantfile
Debug output
https://gist.github.com/der-eismann/e9165908def8df95574c8e67ab3f102b
Expected behavior
The guest should receive a static IP as usual
Actual behavior
The guest receives a dynamic IP via DHCP instead
Steps to reproduce
The text was updated successfully, but these errors were encountered: