-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
RHEL interfaces sometimes come up with the wrong IP #1577
Conversation
preparing a fix for a weird redhat ifdown issue
…ist before ifdown is called, when ifup is called, the interface comes up to the wrong IP address
That is pretty odd... is there any way we can get more info on this? Or hopefully some RHEL user can chime in. |
I'm seeing similar issues with CentOS. Not sure if they're related or not. I'm using the CentOS 6.4 VM from vagrantbox.es:
In my Vagrantfile I have:
When I bring up the VM, I get the following output:
In spite of this, I can ssh in, and sure enough, the eth1 interface is not up, although the contents of the eth1 configuration have been configured by Vagrant. eth0 is up and has a different IP over which the ssh connection occurs. This is what happens when I manually run ifup on the instance:
As an aside, is there any straightforward way to create images for other providers such as vmware_fusion? I remember you mentioned something about that feature coming some time around v1.2. Thanks. |
@mbadran: we've seen the 'Vagrant assumes that this means the command failed! /sbin/ifup eth1 2> /dev/null' error as well, but it only happens when the wrong IP that the interface comes up to is already occupied. |
I'm using a CentOS 6.4 x86_64 guest on Mac OS X 10.8 host with a VirtualBox 4.2.12 provider and Vagrant 1.2.1, experiencing the exact same issue as @mbadran. |
Here's a log: https://gist.github.com/kid-icarus/5430446 |
@mbadran @kid-icarus with this proposed patch, do you still see the same issues? |
Hey @chorankates-sfdc it looks like the patch didn't fix it for me, I still experienced the same behavior :-\ |
I'm having this problem. I believe it is related to these RedHat/Fedora bugs: Basically the files in /etc/sysconfig/network-scripts require the HWADDR which vagrant does not put in. There are workarounds but none work for me. Vagrant should figure out the newly assigned MAC for each interface and add it to the correct file. |
I'm also having this problem. I've been detailing my journey in #921. For details see #921 (comment) for my setup and https://gist.github.com/michael-harrison/5746092 for logs highlighting the issue. |
I managed to find a work around. You can check it out on #921 (comment) |
Added some debugging lines to vagrant-1.2.2/plugins/guests/redhat/cap/configure_networks.rb and noticed the following when running with VirtualBox 4.2.12. Given a Vagrantfile that looks like this:
On the first host to be
|
@onejli, in 1.2.2 at least, network_static.erb is being populated by line 33 in <vagrant_gem_dir>/plugins/guests/redhat/cap/configure_networks.rb: entry = TemplateRenderer.render("guests/redhat/network_#{network[:type]}", :options => network) that file lives in <vagrant_gem_dir>/templates/guests/redhat/ given the input from @jistanidiot above, it might be worth adding an HWADDR value, assuming the options hash contains that data |
Tracked down (part of) my issue to a crufty base box. I had an
First host to be
|
For a temporary solution, I've confirmed that removing I think the real solution will require modifying the logic in configure_networks.rb a bit. Before removing/modifying any existing |
Fixed by #2450. Thanks! |
in our Vagrantfile, we've specified that this host should have the IP address of 192.168.1.46, and while vagrant is doing the right thing in /etc/sysconfig/network-scripts/ifcfg-eth1, we're still coming up to the wrong (192.168.1.180) address. i can provide the Vagrantfile if you'd like, but effectively, we're calling:
agent.vm.network :hostonly, 192.168.1.46
by creating the proper content in ifcfg-eth1 before calling ifdown, i can no longer reproduce this issue. i don't fully understand this interaction (or why it seems to only happen under 'some' circumstances), but a strace shows ifdown definitely reading that file. i can reliably reproduce this issue (with 1.0.5 and 1.1.0) without the change i'm proposing, and can't reproduce it with the change -- and on the machines that didn't see this problem originally, my change doesn't introduce any issues.
we've only seen this with RHEL boxes (5.5 and 6.2), so making change as closely scoped as possible.
choran-kates@chorankates-wsl3:~/git/piab[isd/piab|unique-ips|e697b1f|U]
6:22.12 $ vagrant ssh app
[vagrant@piab1-app1-1-piab ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth1
VAGRANT-BEGIN
The contents below are automatically generated by Vagrant. Do not modify.
BOOTPROTO=static
IPADDR=192.168.1.46
NETMASK=255.255.255.0
DEVICE=eth1
VAGRANT-END
[vagrant@piab1-app1-1-piab ~]$ /sbin/ifconfig | grep -i inet
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet addr:192.168.1.180 Bcast:192.168.1.255 Mask:255.255.255.0
inet addr:127.0.0.1 Mask:255.0.0.0