Skip to content
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

Fix static ipv6 ips on private networks #1436

Conversation

rubenk
Copy link
Contributor

@rubenk rubenk commented Jan 17, 2022

When the :ip is ipv6, set the 'static6' type, so that we select the
correct _static6.erb template to configure the interface in the guest.

With the following configuration, ipv6 works out of the box on CentOS 8:

(1..2).each do |i|
config.vm.define "node#{i}" do |node|
node.vm.hostname = "node#{i}"

  node.vm.network :private_network,
    :ip => "fc00::#{i+9}",
    :netmask => "64",
    :libvirt__dhcp_enabled => false,
    :libvirt__forward_mode => "veryisolated",
    :libvirt__network_name => "test"
end

end

Fixes: #914

When the :ip is ipv6, set the 'static6' type, so that we select the
correct _static6.erb template to configure the interface in the guest.

With the following configuration, ipv6 works out of the box on CentOS 8:
  (1..2).each do |i|
    config.vm.define "node#{i}" do |node|
      node.vm.hostname = "node#{i}"

      node.vm.network :private_network,
        :ip => "fc00::#{i+9}",
        :netmask => "64",
        :libvirt__dhcp_enabled => false,
        :libvirt__forward_mode => "veryisolated",
        :libvirt__network_name => "test"
    end
  end
@electrofelix
Copy link
Contributor

That possibly fixes a few issues, I'll try to link them later so those that ran into the issue are alerted to the fix landing

@rubenk
Copy link
Contributor Author

rubenk commented Jan 17, 2022

alright, thanks. I just tested this with Debian 11 and there it works as well.

Note that this only works if you set the netmask explicitly. It would be nice if we could parse :ip "fc00::10/64" as well.

@electrofelix electrofelix merged commit 8eeceb3 into vagrant-libvirt:master Jan 17, 2022
@rubenk rubenk deleted the fix-ipv6-bringup-on-private-networks branch January 17, 2022 15:00
mmguero pushed a commit to mmguero-dev/vagrant-libvirt that referenced this pull request Jan 18, 2022
When the :ip is ipv6, set the 'static6' type, so that we select the
correct _static6.erb template to configure the interface in the guest.

With the following configuration, ipv6 works out of the box on CentOS 8:

  (1..2).each do |i|
    config.vm.define "node#{i}" do |node|
      node.vm.hostname = "node#{i}"

      node.vm.network :private_network,
        :ip => "fc00::#{i+9}",
        :netmask => "64",
        :libvirt__dhcp_enabled => false,
        :libvirt__forward_mode => "veryisolated",
        :libvirt__network_name => "test"
    end
  end

Fixes: vagrant-libvirt#914
@dereknola
Copy link

@electrofelix When is the next release coming out? I would love to have this PR, right now I am stuck manually building.

@electrofelix
Copy link
Contributor

@dereknola finally done there this evening. I've been trying to wait until I thought I would have time to respond to any critical issues that might appear shortly after release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

impossible to create private_network static IP with only an IPv6
3 participants