Skip to content

Commit

Permalink
vagrant: workaround to fix private network ip address in fedora
Browse files Browse the repository at this point in the history
Fedora stop supporting syconfig network script so we added a workaround
here
hashicorp/vagrant#12762 (comment)
to fix it.
  • Loading branch information
MrFreezeex committed Aug 1, 2023
1 parent 93e788d commit f6acb01
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ Vagrant.configure("2") do |config|
end

ip = "#{$subnet}.#{i+100}"
node.vm.network :private_network, ip: ip,
node.vm.network :private_network,
:ip => ip,
:libvirt__guest_ipv6 => 'yes',
:libvirt__ipv6_address => "#{$subnet_ipv6}::#{i+100}",
:libvirt__ipv6_prefix => "64",
Expand All @@ -222,6 +223,14 @@ Vagrant.configure("2") do |config|
node.vm.provision "shell", inline: "rm -f /etc/modprobe.d/local.conf"
node.vm.provision "shell", inline: "sed -i '/net.ipv6.conf.all.disable_ipv6/d' /etc/sysctl.d/99-sysctl.conf /etc/sysctl.conf"
end
# Hack for fedora37/38 to get the IP address of the second interface
if ["fedora37", "fedora38"].include? $os
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
end

# Disable firewalld on oraclelinux/redhat vms
if ["oraclelinux","oraclelinux8","rhel7","rhel8","rockylinux8"].include? $os
Expand Down

0 comments on commit f6acb01

Please sign in to comment.