From 7b41f8160bb8947f51a7f018a8d888d1aa5f14c4 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 22 Apr 2022 08:47:15 -0700 Subject: [PATCH] Fix dhcp-all-interfaces on debuntu systems There are two issues with dhcp-all-interfaces on debuntu interfaces addressed here. First is the path to dhclient lease files is /var/lib/dhcp not /var/lib/dhclient. Second there is a missing newline in the ENI interface file which causes a parse error. Change-Id: Ice83e0d49a4234301dc12daf828ba80fef414cdb --- .../dhcp-all-interfaces/install.d/dhcp-all-interfaces.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.sh b/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.sh index e63f3c20..cf5b1b5f 100755 --- a/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.sh +++ b/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.sh @@ -79,7 +79,7 @@ function enable_interface() { printf "auto $interface\niface $interface inet dhcp\n\n" >>$ENI_FILE if [ "$ipv6_init" == "True" ]; then # Make DUID-UUID Type 4 (RFC 6355) - echo "default-duid \"\\x00\\x04$(sed 's/.\{2\}/\\x&/g' < /etc/machine-id)\";" >"/var/lib/dhclient/dhclient6--$interface.lease" + echo "default-duid \"\\x00\\x04$(sed 's/.\{2\}/\\x&/g' < /etc/machine-id)\";" >"/var/lib/dhcp/dhclient6--$interface.lease" if [ $ipv6_AdvManagedFlag == "Yes" ]; then # IPv6 DHCPv6 Stateful address configuration printf "iface $interface inet6 dhcp\n\n" >>$ENI_FILE @@ -90,7 +90,7 @@ function enable_interface() { echo "DHCPv6 Stateless Configured." else # IPv6 Autoconfiguration (SLAAC) - printf "iface $interface inet6 auto\tdhcp 0\n\n" >>$ENI_FILE + printf "iface $interface inet6 auto\n\tdhcp 0\n\n" >>$ENI_FILE echo "IPv6 SLAAC Configured" fi fi