Fixing ubuntu ifdown error for ens3
Ubuntu ifdown script cannot handle old address when it was wiped
from /etc/network/interfaces
It fails and causes
RTNETLINK answers: No such process
RTNETLINK answers: Cannot assign requested address
error.
This patch fixes this behavior by:
1) proper flushing all the addresses from ens3
2) removing ifstate flag, so further ifup script could set it up.
diff --git a/config-drive/master_config.sh b/config-drive/master_config.sh
index fe0587d..a131f3e 100644
--- a/config-drive/master_config.sh
+++ b/config-drive/master_config.sh
@@ -8,7 +8,9 @@
echo "Configuring network interfaces"
envsubst < /root/interfaces > /etc/network/interfaces
-ifdown ens3; ifup ens3
+ip a flush dev ens3
+rm /var/run/network/ifstate.ens3
+ifup ens3
echo "Preparing metadata model"
mount /dev/cdrom /mnt/
@@ -58,4 +60,4 @@
ssh-keyscan cfg01 > /var/lib/jenkins/.ssh/known_hosts
-reboot
\ No newline at end of file
+reboot