vagrant-hostmanager icon indicating copy to clipboard operation
vagrant-hostmanager copied to clipboard

Support multiple NICs

Open drazenzubovic opened this issue 8 years ago • 0 comments
trafficstars

Vagrant actually supports multiple adapters for a single VM, like two in this case:

Vagrant.configure("2") do |config|
  config.hostmanager.enabled = true
  config.hostmanager.manage_host = true
  config.hostmanager.ignore_private_ip = false
  config.hostmanager.include_offline = true
  config.vm.define 'example-box' do |node|
    node.vm.hostname = 'example-box-hostname'

    node.vm.network "private_network", ip: '192.168.42.42'
    node.vm.network "private_network", ip: '10.0.0.42'

    node.hostmanager.aliases = %w(example-box.localdomain example-box-alias)
  end
end

Executing the script Vagrant will create and configure two private NICs. However hostmanager will only see and create entries in /etc/hosts for the first listed adapter.

It would be a good idea to extend the functionality and also support aliasing for multiple NICs with the hostmanager.

drazenzubovic avatar Feb 21 '17 12:02 drazenzubovic