[MOD] Change the way FreeBSD network interfaces are configured. Fixes #5852

This commit is contained in:
Andres Montalban 2016-03-01 19:28:09 -03:00
parent ebcc73f338
commit 492ba40fd1
1 changed files with 2 additions and 5 deletions

View File

@ -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