mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-05-28 04:36:05 -04:00
Allow custom subnet to be provided when private network type is dhcp
This commit is contained in:
parent
afb6c20581
commit
670bef6596
2 changed files with 2 additions and 2 deletions
|
|
@ -55,7 +55,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
@logger.debug("Connecting network #{network_name} to container guest #{machine.name}")
|
||||
if options[:ip]
|
||||
if options[:ip] && options[:type] != "dhcp"
|
||||
if IPAddr.new(options[:ip]).ipv4?
|
||||
network_options[:ip] = options[:ip]
|
||||
else
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ module VagrantPlugins
|
|||
network_name = root_options[:name]
|
||||
end
|
||||
|
||||
if root_options[:type].to_s == "dhcp"
|
||||
if root_options[:type].to_s == "dhcp" && !root_options[:ip]
|
||||
network_name = "vagrant_network" if !network_name
|
||||
return [network_name, network_options]
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue