Roman Zenka
Roman Zenka

Reputation: 3604

Set up DHCP server IP for Vagrant

I am using Vagrant 1.1.2 on Mac OS X 10.7.5

I am running into an issue with the default networking setup. The network seems to be configured to use a DHCP server providing IPs from 10.0.2.? network, with the gateway being set to 10.0.2.2

Sadly, in the organization I work for, there actually exists a server at 10.0.2.2, which causes huge network communication delays.

How can I configure Vagrant's VirtualBox to use DHCP server providing IPs from a different network? The documentation at http://www.vagrantup.com/ completely ignores this issue, which unfortunately renders my Vagrant useless.

When I disconnect from the corporate network, Vagrant works as expected. So I am quite sure the issue is in the IP collision.

Upvotes: 9

Views: 6116

Answers (1)

cmur2
cmur2

Reputation: 2624

That's more a VirtualBox issue so should have to get Vagrant to set a VirtualBox option for a different DHCP subnet like so:

  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--natnet1", "192.168/16"]
  end

Upvotes: 15

Related Questions