From: Stéphane Graber Date: Thu, 13 Oct 2016 18:32:03 +0000 (-0400) Subject: archlinux: Do DHCP on eth0 X-Git-Tag: lxc-1.0.9~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e224b75f4a8e8bea45b4fd304c44fd5c7b7b9241;p=thirdparty%2Flxc.git archlinux: Do DHCP on eth0 Signed-off-by: Stéphane Graber --- diff --git a/templates/lxc-archlinux.in b/templates/lxc-archlinux.in index 6ea80a788..c2e24e3e2 100755 --- a/templates/lxc-archlinux.in +++ b/templates/lxc-archlinux.in @@ -97,6 +97,15 @@ EOF [ "${r#nameserver}" = "$r" ] || echo "$r" done < /etc/resolv.conf > "${rootfs_path}/etc/resolv.conf" + # network configuration + cat > "${rootfs_path}/etc/systemd/network/eth0.network" << EOF +[Match] +Name=eth0 + +[Network] +DHCP=ipv4 +EOF + # chroot and configure system arch-chroot "${rootfs_path}" /bin/bash -s << EOF mkdir /run/lock @@ -120,6 +129,9 @@ sed -e 's/^ConditionPathIsReadWrite=\/proc\/sys\/$/ConditionPathIsReadWrite=\/pr # initialize pacman keyring pacman-key --init pacman-key --populate archlinux + +# enable networkd +systemctl enable systemd-networkd EOF return 0 }