Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Change the eth0 ip because oft IP conflict #2915
Hi, we are using the 10.0.0.0 net at work for our Servers. Server within that net are not reachable from a vagrant virtualbox. Even adding a public_network interface using DHCP only works if i explicitly set the interface eth1 in the ping Command. My solution now was to add a Route for the destination IP, but this is a annoying workaround. Is it possible to set a different eth0 IP in the vagrantfile or could this be implemented?
you usually end having eth0 on the NAT network in virtualbox, then on
if I read your email and I understand it correctly, you have a network in
can you paste here the output of
and tellme your host and guest os?
On Fri, Jan 31, 2014 at 8:13 AM, Benjamin Boit email@example.com:
eth0 Link encap:Ethernet HWaddr 08:00:27:47:e9:26
eth1 Link encap:Ethernet HWaddr 08:00:27:5e:8d:96
eth2 Link encap:Ethernet HWaddr 08:00:27:f5:dc:de
lo Link encap:Local Loopback
Kernel IP routing table
route add -host 10.0.2.114 dev eth2
fixes it, but only for 10.0.2.114 .... (dont want to add each internal server there)
eth2 is used to connect to the interal net (dhcp), eth1 has a static ip to use for etc/hosts (dont know how to update on vagrant up, plugins for that are not working .... )
According to https://www.virtualbox.org/manual/ch09.html#changenat ,
This can be fixed by modifying your
config.vm.provider "virtualbox" do |vb| [...] vb.customize ['modifyvm', :id, '--natnet1', '192.168.222.0/24'] [...] end
Thanks @mckelvin - my Vagrantfile was booting 7 VM's that refused to talk to each other and your snippit allowed me to move off the 10.0.2 subnet. This in turn avoided some IP clash somewhere on my work network. The clue was running a port scan on my vagrant provisioned salt-master - the results came back with a load of listening ports not appropriate to the VM i.e. some other machine somewhere. For reference on CentOS you can do this as follows:
In the above example my salt-master is 192.168.0.100 so I called nmap from a minion to see what ports it was exposing and couldn't see a listener on 4506 or any familiar services.
I'm going to lock this issue because it has been closed for 30 days
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.