mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Merge pull request #505 from brk3/master
Allow disabling guest-to-guest ipv6 comms in libvirt networks
This commit is contained in:
commit
1bb8fff485
@ -396,6 +396,8 @@ starts with 'libvirt__' string. Here is a list of those options:
|
||||
* `:libvirt__tunnel_local_ip` - Sets the local IP used by the udp tunnel
|
||||
interface type. It populates the ip entry of the `<local address=XXX">` section of
|
||||
the interface xml configuration. _(This feature only works in libvirt 1.2.20 and higher)_
|
||||
* `:libvirt__guest_ipv6` - Enable or disable guest-to-guest IPv6 communication.
|
||||
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.
|
||||
* `:mac` - MAC address for the interface.
|
||||
* `:model_type` - parameter specifies the model of the network adapter when you create a domain value by default virtio KVM believe possible values, see the documentation for libvirt
|
||||
|
||||
@ -425,6 +427,7 @@ configurable at the provider level.
|
||||
|
||||
* `management_network_name` - Name of libvirt network to which all VMs will be connected. If not specified the default is 'vagrant-libvirt'.
|
||||
* `management_network_address` - Address of network to which all VMs will be connected. Must include the address and subnet mask. If not specified the default is '192.168.121.0/24'.
|
||||
* `management_network_guest_ipv6` - Enable or disable guest-to-guest IPv6 communication. 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.
|
||||
|
||||
You may wonder how vagrant-libvirt knows the IP address a VM received.
|
||||
Libvirt doesn't provide a standard way to find out the IP address of a running
|
||||
|
@ -58,6 +58,7 @@ module VagrantPlugins
|
||||
created: false,
|
||||
active: false,
|
||||
autostart: false,
|
||||
guest_ipv6: @options[:guest_ipv6] || 'yes',
|
||||
libvirt_network: nil
|
||||
}
|
||||
|
||||
@ -270,6 +271,7 @@ module VagrantPlugins
|
||||
@network_bridge_name = @interface_network[:bridge_name]
|
||||
@network_address = @interface_network[:ip_address]
|
||||
@network_netmask = @interface_network[:netmask]
|
||||
@guest_ipv6 = @interface_network[:guest_ipv6]
|
||||
|
||||
@network_forward_mode = @options[:forward_mode]
|
||||
if @options[:forward_device]
|
||||
|
@ -48,6 +48,7 @@ module VagrantPlugins
|
||||
attr_accessor :management_network_address
|
||||
attr_accessor :management_network_mode
|
||||
attr_accessor :management_network_mac
|
||||
attr_accessor :management_network_guest_ipv6
|
||||
|
||||
# Default host prefix (alternative to use project folder name)
|
||||
attr_accessor :default_prefix
|
||||
@ -110,6 +111,7 @@ module VagrantPlugins
|
||||
@management_network_address = UNSET_VALUE
|
||||
@management_network_mode = UNSET_VALUE
|
||||
@management_network_mac = UNSET_VALUE
|
||||
@management_network_guest_ipv6 = UNSET_VALUE
|
||||
|
||||
# Domain specific settings.
|
||||
@uuid = UNSET_VALUE
|
||||
@ -342,6 +344,7 @@ module VagrantPlugins
|
||||
@management_network_address = '192.168.121.0/24' if @management_network_address == UNSET_VALUE
|
||||
@management_network_mode = 'nat' if @management_network_mode == UNSET_VALUE
|
||||
@management_network_mac = nil if @management_network_mac == UNSET_VALUE
|
||||
@management_network_guest_ipv6 = 'yes' if @management_network_guest_ipv6 == UNSET_VALUE
|
||||
|
||||
# generate a URI if none is supplied
|
||||
@uri = _generate_uri() if @uri == UNSET_VALUE
|
||||
|
@ -1,4 +1,4 @@
|
||||
<network ipv6='yes'>
|
||||
<network ipv6='<%= @guest_ipv6 %>'>
|
||||
<name><%= @network_name %></name>
|
||||
<bridge name="<%= @network_bridge_name %>" />
|
||||
|
||||
|
@ -12,6 +12,7 @@ module VagrantPlugins
|
||||
management_network_address = env[:machine].provider_config.management_network_address
|
||||
management_network_mode = env[:machine].provider_config.management_network_mode
|
||||
management_network_mac = env[:machine].provider_config.management_network_mac
|
||||
management_network_guest_ipv6 = env[:machine].provider_config.management_network_guest_ipv6
|
||||
logger.info "Using #{management_network_name} at #{management_network_address} as the management network #{management_network_mode} is the mode"
|
||||
|
||||
begin
|
||||
@ -36,6 +37,7 @@ module VagrantPlugins
|
||||
netmask: $2,
|
||||
dhcp_enabled: true,
|
||||
forward_mode: management_network_mode,
|
||||
guest_ipv6: management_network_guest_ipv6,
|
||||
}
|
||||
|
||||
unless management_network_mac.nil?
|
||||
|
Loading…
Reference in New Issue
Block a user