From 492ba40fd159052a690014c97a4ff7472d64ffbc Mon Sep 17 00:00:00 2001 From: Andres Montalban Date: Tue, 1 Mar 2016 19:28:09 -0300 Subject: [PATCH] [MOD] Change the way FreeBSD network interfaces are configured. Fixes #5852 --- plugins/guests/freebsd/cap/configure_networks.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/guests/freebsd/cap/configure_networks.rb b/plugins/guests/freebsd/cap/configure_networks.rb index af1ecaa59..27dfc850d 100644 --- a/plugins/guests/freebsd/cap/configure_networks.rb +++ b/plugins/guests/freebsd/cap/configure_networks.rb @@ -39,11 +39,8 @@ module VagrantPlugins machine.communicate.sudo("su -m root -c 'cat /tmp/vagrant-network-entry >> /etc/rc.conf'", {shell: "sh"}) machine.communicate.sudo("rm -f /tmp/vagrant-network-entry", {shell: "sh"}) - if network[:type].to_sym == :static - machine.communicate.sudo("ifconfig #{ifname} inet #{network[:ip]} netmask #{network[:netmask]}", {shell: "sh"}) - elsif network[:type].to_sym == :dhcp - machine.communicate.sudo("dhclient #{ifname}", {shell: "sh"}) - end + # Restart interface so it loads configuration stored in /etc/rc.conf + machine.communicate.sudo("service netif restart #{ifname}", {shell: "sh"}) end end end