mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Allow veryisolated networks
With veryisolated networks, there is no ip address assigned thus matching the network name and ip address fails. This allows the null ip address to match a named network when that forward_mode is set.
This commit is contained in:
parent
1baecfd694
commit
81688f0fd9
@ -116,13 +116,16 @@ module VagrantPlugins
|
|||||||
# @available_networks should be filled before calling this function.
|
# @available_networks should be filled before calling this function.
|
||||||
def handle_ip_option(env)
|
def handle_ip_option(env)
|
||||||
return if !@options[:ip]
|
return if !@options[:ip]
|
||||||
|
net_address = nil
|
||||||
|
if @options[:forward_mode] != 'veryisolated'
|
||||||
net_address = network_address(@options[:ip], @options[:netmask])
|
net_address = network_address(@options[:ip], @options[:netmask])
|
||||||
@interface_network[:network_address] = net_address
|
|
||||||
|
|
||||||
# Set IP address of network (actually bridge). It will be used as
|
# Set IP address of network (actually bridge). It will be used as
|
||||||
# gateway address for machines connected to this network.
|
# gateway address for machines connected to this network.
|
||||||
net = IPAddr.new(net_address)
|
net = IPAddr.new(net_address)
|
||||||
|
end
|
||||||
|
|
||||||
|
@interface_network[:network_address] = net_address
|
||||||
|
|
||||||
# Default to first address (after network name)
|
# Default to first address (after network name)
|
||||||
@interface_network[:ip_address] = @options[:host_ip].nil? ? net.to_range.begin.succ : IPAddr.new(@options[:host_ip])
|
@interface_network[:ip_address] = @options[:host_ip].nil? ? net.to_range.begin.succ : IPAddr.new(@options[:host_ip])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user