hello narada before packaging the box there is some tidy up that need to happen on the guest
if the file /etc/udev/rules.d/70-persistent-net.rules or similar exists, delete it on top of that, when there is no network configuration on the vagrantfile, always will be eth0 on the host so when you add one network to vagrantifle, that network will become eth1 in virtualbox, it's normal that eth0 be 10.0.0.5 nat, that is hardcoded by design. so by design, also happen eth0 does route over nat, and eth1 or any other network that is not dhcp usually have lo router. To overcome this, some people use a shell provisioner to remove and then add a new route. If you can explain a bit what you are trying to do on top of the normal default output, I am sure people on the mailing list can help Alvaro. On Fri, Apr 24, 2015 at 2:35 AM, Narada Hess <[email protected]> wrote: > If I create a VM using bridged networking from virtualbox directly, the VM > IP address assigned is on the same subnet as my host and the VM can be > pinged from any other host on the subnet. Good. ifconfig shows an IP > address on eth0 within the normal external subnet range. There is no eth1. > > But if I create the VM from vagrant, I cannot ping the VM from other hosts. > ifconfig now shows two adapters. eth0 has a 10.0.2.x address that does not > match my actual subnet, and the route command shows 10.0.2.2 as the default > gateway. eth1 now shows up, with an address that looks like a correctly > allocated address from the real DHCP server. But pinging its address form > an external host does not work. > > I have this command in Vagrantfile: > config.vm.network "public_network", bridge: 'eth0', type: "dhcp" > I have also tried: > config.vm.network "public_network" > and > config.vm.network "public_network", bridge: 'eth0' > > I am using Ubuntu 14.04 and latest versions of vagrant (1.7.2) and > virtualbox (4.3.26). I suspect the 10.0.2.x DHCP address is being generated > locally (within my host) and thus is not registered with the real DHCP > server (and is thus not being routed). > > Thanks to anyone who can help me with this. > > -- > You received this message because you are subscribed to the Google Groups > "Vagrant" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
