New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the eth0 ip because oft IP conflict #2915
Comments
hello 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 ifconfig -a and tellme your host and guest os? On Fri, Jan 31, 2014 at 8:13 AM, Benjamin Boit notifications@github.comwrote:
|
ifconfig -a 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 route -n 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 .... ) |
Host OS is Ubuntu (mint) and guest if Debian Wheezy. |
eth0 in Vagrant for now is always NAT. The NAT IP is determined by VirtualBox settings that Vagrant doesn't touch. You can change the NAT IP range by configuring VirtualBox itself. |
on a multi-vm vagrant env, this ip is always the same, so how to get a different one, because some services relies on the default ethernet interface. |
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 ALSO SEE: |
All, |
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. |
thanks @mckelvin - nice trick
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. 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. |
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?
The text was updated successfully, but these errors were encountered: