From aac50c3f75d675dc51b1351c462514a59ba56979 Mon Sep 17 00:00:00 2001 From: bunchc Date: Mon, 25 Mar 2019 15:44:07 -0500 Subject: [PATCH] Adding a catch-all DHCP configuration It appears that for libvirt/kvm the interfaces are renumbered in such a way as they do not come up when booted by Vagrant. To fix that I have added a catch-all interface configuration in `/etc/systemd/network/`. --- scripts/cleanup.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index d955ddc..ae7840f 100644 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -51,6 +51,15 @@ if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then sudo rm /etc/udev/rules.d/70-persistent-net.rules fi +#add failsafe DHCP config for systemd-networkd +if [ -d /etc/systemd/network ]; then + echo "[Match] +Name=en* + +[Network] +DHCP=ipv4" | sudo tee 99-dhcp-default.network +fi + #cleanup /tmp directories sudo rm -rf /tmp/* sudo rm -rf /var/tmp/* @@ -63,4 +72,4 @@ sudo bash -c "cat /dev/null > /etc/hostname" #cleanup shell history history -w -history -c \ No newline at end of file +history -c