From 3fa3e995a97d8a2d9705a5b483338009315bfeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Thu, 1 Feb 2018 16:45:58 +0100 Subject: [PATCH] Debian: Renew DHCP lease on hostname change --- plugins/guests/debian/cap/change_host_name.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/guests/debian/cap/change_host_name.rb b/plugins/guests/debian/cap/change_host_name.rb index 877416cc3..8f31341b7 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -32,6 +32,10 @@ module VagrantPlugins if test -f /etc/init.d/hostname.sh; then /etc/init.d/hostname.sh start || true fi + if test -x /sbin/dhclient ; then + /sbin/dhclient -r + /sbin/dhclient -nw + fi EOH end end