Private Network using VirtualBox-DHCP

610 views
Skip to first unread message

Robert Conrad

unread,
Jul 25, 2013, 3:48:55 AM7/25/13
to vagra...@googlegroups.com
Hey,

after updating Vagrant (OS X) from 1.2.2 to 1.2.4 I'm not able to configure a private network using a dynamic IP-address provided by VirtualBox-DHCP-server:

config.vm.network :private_network, type: "dhcp"

But the network interface in basebox expects to be configured via DHCP. Is that bug known?

I researched on plugins/kernel_v2/config/vm.rb in the validate-method and theoretically it should work:

[...]
          if type == :private_network
            if options[:type] != :dhcp
              if !options[:ip]
                errors << I18n.t("vagrant.config.vm.network_ip_required")
              end
            end
          end
[...]

It seems the option "type" is not passed to validate() correctly.

Can you give me a hint how to get this working again, please?

With kind regards
Robert

Nic'

unread,
Mar 17, 2014, 7:10:03 PM3/17/14
to vagra...@googlegroups.com
same situation,

private network doesnt give a DHCP address, error " An IP is required for a private network." 

my config line is:  config.vm.network "private_network", type: "dhcp"
any hint ?
thanks

Alvaro Miranda Aguilera

unread,
Mar 17, 2014, 8:35:43 PM3/17/14
to vagra...@googlegroups.com

On Tue, Mar 18, 2014 at 12:10 PM, Nic' <houil...@gmail.com> wrote:
uillet 2013


Hello,

you did reply an email from 2013.. taking vagrant move very fast, best is just create a new one.

Are you using virtualbox or vmware?

for virtualbox, it should work.. for vmware, I have been reading some times there is no DHCP in the network and that cause to fail.

in that private network, you need to pass the IP as an argument, otherwise, if you get any random ip, how you will use it?

Try this:

config.vm.network :private_network, ip: "192.168.33.10"

and replace the IP, with one suit what you want to test.

let me know how it goes (and provide more information, what os, version of vagrant and vmware/virtualbox)

Alvaro.


Nic'

unread,
Mar 19, 2014, 4:53:30 PM3/19/14
to vagra...@googlegroups.com
Just for following up , yes it works well when an IP is specified.
so ok , no dhcp in private network.

Cheers,
Nic'

Nic'

unread,
Mar 20, 2014, 6:02:01 PM3/20/14
to vagra...@googlegroups.com
Fixed using vagrant-auto-network plugin https://github.com/adrienthebo/vagrant-auto_network

and the following line in vagrantfile :

config.vm.network :private_network, :ip =>'0.0.0.0', :auto_network => true  

Have to define a DHCP pool if required , there is one by default.

cheers.
Reply all
Reply to author
Forward
0 new messages