virtualbox: handle a list of bridged nics
This change allows you to specify multiple network interfaces to bridge to, picking the first found. ```ruby config.vm.network "public_network", bridge: ["en4: Thunderbolt Ethernet", "en6: Broadcom NetXtreme Gigabit Ethernet Controller", "en0: Wi-Fi (AirPort)"] ```
This commit is contained in:
parent
1cf2a8db4c
commit
2b3411965a
|
@ -157,7 +157,9 @@ module VagrantPlugins
|
||||||
@logger.debug("Bridge was directly specified in config, searching for: #{config[:bridge]}")
|
@logger.debug("Bridge was directly specified in config, searching for: #{config[:bridge]}")
|
||||||
|
|
||||||
# Search for a matching bridged interface
|
# Search for a matching bridged interface
|
||||||
bridge = config[:bridge]
|
bridges = config[:bridge]
|
||||||
|
bridges = [bridges] if not bridges.respond_to?(:each)
|
||||||
|
bridges.each do |bridge|
|
||||||
bridge = bridge.downcase if bridge.respond_to?(:downcase)
|
bridge = bridge.downcase if bridge.respond_to?(:downcase)
|
||||||
bridgedifs.each do |interface|
|
bridgedifs.each do |interface|
|
||||||
if bridge === interface[:name].downcase
|
if bridge === interface[:name].downcase
|
||||||
|
@ -166,6 +168,8 @@ module VagrantPlugins
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
break if chosen_bridge
|
||||||
|
end
|
||||||
|
|
||||||
# If one wasn't found, then we notify the user here.
|
# If one wasn't found, then we notify the user here.
|
||||||
if !chosen_bridge
|
if !chosen_bridge
|
||||||
|
|
Loading…
Reference in New Issue