Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DHCP / Dynamic IP #56

Open
njt1982 opened this issue Jan 12, 2015 · 6 comments
Open

DHCP / Dynamic IP #56

njt1982 opened this issue Jan 12, 2015 · 6 comments

Comments

@njt1982
Copy link

njt1982 commented Jan 12, 2015

Am I correct in thinking this plugin does not work for networks that use DHCP?

eg:

  config.vm.network "private_network", type: "dhcp"
@njt1982
Copy link
Author

njt1982 commented Jan 12, 2015

Seems not - have got around this by using the HostManager plugin instead as that allows us to extend the ip resolver:

  if Vagrant.has_plugin?("vagrant-hostmanager")
    config.hostmanager.ip_resolver = proc do |vm, resolving_vm|
      if vm.id
        `VBoxManage guestproperty get #{vm.id} "/VirtualBox/GuestInfo/Net/1/V4/IP"`.split()[1]
      end
    end

    config.hostmanager.enabled = true
    config.hostmanager.manage_host = true
    config.hostmanager.ignore_private_ip = false
    config.hostmanager.include_offline = true
    config.hostmanager.aliases = [ "wibble.dev" ]
  end

This, of course, assumes VirtualBox as the host. See: devopsgroup-io/vagrant-hostmanager#86

@cgsmith
Copy link
Collaborator

cgsmith commented Nov 4, 2015

@njt1982 I am looking at contributions to get dhcp working well with vagrant-hostsupdater

@iampuma
Copy link

iampuma commented Jan 17, 2016

Would be great if this could be supported. For now I also recommend the solution @njt1982 suggests, thanks.

@J7mbo
Copy link

J7mbo commented Mar 23, 2017

This has been open since 2015. Does host manager work better still?

@dincho
Copy link

dincho commented Mar 23, 2017

This has been open since 2015. Does host manager work better still?

Nope.

@cgsmith
Copy link
Collaborator

cgsmith commented Jul 19, 2017

Still looking for PRs or attempts at this! I haven't had time yet but feel it would be a great addition to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants