diff --git a/README.md b/README.md
index 1c74962..058f334 100644
--- a/README.md
+++ b/README.md
@@ -458,6 +458,12 @@ An examples of network interface definitions:
# default is 127.0.0.1 if omitted
# :libvirt__tunnel_ip => '127.0.0.1',
:libvirt__tunnel_port => '11111'
+ # network with ipv6 support
+ test_vm1.vm.network :private_network,
+ :ip => "10.20.5.42",
+ :libvirt__guest_ipv6 => "yes",
+ :libvirt__ipv6_address => "2001:db8:ca2:6::1",
+ :libvirt__ipv6_prefix => "64"
# Guest 2
config.vm.define :test_vm2 do |test_vm2|
@@ -466,6 +472,12 @@ An examples of network interface definitions:
# default is 127.0.0.1 if omitted
# :libvirt__tunnel_ip => '127.0.0.1',
:libvirt__tunnel_port => '11111'
+ # network with ipv6 support
+ test_vm2.vm.network :private_network,
+ :ip => "10.20.5.45",
+ :libvirt__guest_ipv6 => "yes",
+ :libvirt__ipv6_address => "2001:db8:ca2:6::1",
+ :libvirt__ipv6_prefix => "64"
# Public Network
@@ -557,6 +569,8 @@ starts with `libvirt__` string. Here is a list of those options:
See [here](https://libvirt.org/formatnetwork.html#examplesPrivate6), and
[here](http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=705e67d40b09a905cd6a4b8b418d5cb94eaa95a8)
for for more information. *Note: takes either 'yes' or 'no' for value*
+* `:libvirt__ipv6_address` - Define ipv6 address, require also prefix.
+* `:libvirt__ipv6_prefix` - Define ipv6 prefix. generate string ``
* `:libvirt__iface_name` - Define a name for the private network interface.
With this feature one can [simulate physical link
failures](https://github.com/vagrant-libvirt/vagrant-libvirt/pull/498)
diff --git a/lib/vagrant-libvirt/action/create_networks.rb b/lib/vagrant-libvirt/action/create_networks.rb
index 03d2b46..a619fa6 100644
--- a/lib/vagrant-libvirt/action/create_networks.rb
+++ b/lib/vagrant-libvirt/action/create_networks.rb
@@ -56,6 +56,8 @@ module VagrantPlugins
netmask: @options[:netmask],
network_address: nil,
bridge_name: nil,
+ ipv6_address: options[:ipv6_address] || nil,
+ ipv6_prefix: options[:ipv6_prefix] || nil,
created: false,
active: false,
autostart: false,
@@ -282,6 +284,9 @@ module VagrantPlugins
@network_netmask = @interface_network[:netmask]
@guest_ipv6 = @interface_network[:guest_ipv6]
+ @network_ipv6_address = @interface_network[:ipv6_address]
+ @network_ipv6_prefix = @interface_network[:ipv6_prefix]
+
@network_forward_mode = @options[:forward_mode]
if @options[:forward_device]
@network_forward_device = @options[:forward_device]
diff --git a/lib/vagrant-libvirt/templates/private_network.xml.erb b/lib/vagrant-libvirt/templates/private_network.xml.erb
index d7547c7..48e82ee 100644
--- a/lib/vagrant-libvirt/templates/private_network.xml.erb
+++ b/lib/vagrant-libvirt/templates/private_network.xml.erb
@@ -27,4 +27,8 @@
<% end %>
+ <% if !@network_ipv6_address.nil? && !@network_ipv6_prefix.nil? %>
+
+ <% end %>
+