From 3f358f5df6fc1bd50f0e2ab7aaa5736b88f44e72 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Sat, 16 Oct 2010 22:18:05 +1100 Subject: [PATCH] Ensure host-only interface is down before reconfiguring it. --- lib/vagrant/systems/linux.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vagrant/systems/linux.rb b/lib/vagrant/systems/linux.rb index 4be54dd4d..021a687b7 100644 --- a/lib/vagrant/systems/linux.rb +++ b/lib/vagrant/systems/linux.rb @@ -80,6 +80,7 @@ module Vagrant vm.ssh.upload!(StringIO.new(entry), "/tmp/vagrant-network-entry") vm.ssh.execute do |ssh| + ssh.exec!("sudo /sbin/ifdown eth#{net_options[:adapter]} 2> /dev/null") ssh.exec!("sudo su -c 'cat /tmp/vagrant-network-entry >> /etc/network/interfaces'") ssh.exec!("sudo /sbin/ifup eth#{net_options[:adapter]}") end