mitchellh/vagrant — Issue #703: Default route management with NAT & Bridged interfaces on CentOS
Author: withnail
Created: 2012-02-02 15:12:25+00:00
State: open

I'm having trouble with a race condition with a CentOS 6.2 guest VM.

config.vm.define :monitor do |box_config|
box_config.vm.network :bridged
end

In this scenario there are two interfaces created in the guest VM: eth0 as NAT and eth1 as bridged.

However, since both are set to DHCP there is a race condition to decide which one provides the default route. I believe in redhat/centos it is possible to specify GATEWAYDEV=eth1 in /etc/sysconfig/network to ensure that route is only set on one interface.

Also, I'm not sure if ifconfig up /ifconfig down as part of the 'vagrant up' command are helping. Are these to reapply network changes?

As an aside I notice if you run with no NAT port then vagrant console doesn't work. Would it be possible to get the relevant settings via VBoxManage guestcontrol and parse the ifconfig output?