So I think I'm running into this
https://bugzilla.redhat.com/show_bug.cgi?id=192084 so-called notabug bug. Google turned up info that lots of people do the following before they export their .box file:
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm /lib/udev/rules.d/75-persistent-net-generator.rules
rm -rf /dev/.udev/
sed -i "/^HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-Auth_eth0
I've done that, re-exported my box, rm it from vagrant and re-imported it. Then vagrant up.
with the following stuff in the Vagrantfile
config.vm.box = "RHEL6_x86_64"
config.vm.network :private_network, ip: "192.168.56.3", :adapter => 2
config.vm.provider "virtualbox" do |v|
v.gui = true
end
This brings up a box that has the NAT on eth0 and on eth1 it gets 192.168.56.x where x is obviously from dhcp instead of the assigned value.
On the guest I can do the following:
$> /sbin/ifdown eth1
Device state: 3 (disconnected)
$> /sbin/ifup eth1
Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
However that sets eth0 to 192.168.56.3 and because it is on the wrong adapter I can no longer ssh to the box (or even vagrant ssh).
Is there a way to fix this?
Oh and here's the relevant section of the debug log:
INFO guest: Detected: redhat!
INFO guest: Full guest chain: [[:redhat, #<VagrantPlugins::GuestRedHat::Guest:0x00000002029e58>], [:linux, #<VagrantPlugins::GuestLinux::Guest:0x007fe0c079a998>]]
INFO guest: Execute capability: configure_networks (redhat)
DEBUG guest: Searching for cap: configure_networks
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: configure_networks in redhat
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
INFO ssh: SSH is ready!
INFO guest: Execute capability: network_scripts_dir (redhat)
DEBUG guest: Searching for cap: network_scripts_dir
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: network_scripts_dir in redhat
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: touch /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/sysconfig/network-scripts/ifcfg-eth1 > /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: cat /tmp/vagrant-ifcfg-eth1 > /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: rm /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /tmp/vagrant20130528-24693-s6c4um to /tmp/vagrant-network-entry_1
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: ERROR : [ipv6_test_device_status] Missing parameter 'device' (arg 1)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: rm /tmp/vagrant-network-entry_1 (sudo=true)
DEBUG ssh: Exit status: 0
Thanks in advance.