Why is My Private IP Missing From My CentOS 7 Server?

Why is my private IP missing from my CentOS 7 server?

When restarting a CentOS 7 server after adding it to a private network, the configuration of the new private network interface may fail, leaving it without an IP address. This can be fixed with another attempt after applying a small change to cloud-init:

# Patch cloud-init
sudo sed "s/== 'static'/in ['static', 'static6']/" -i /usr/lib/python2.7/site-packages/cloudinit/net/sysconfig.py

# Reset cloud-init
sudo cloud-init clean

# Reboot to apply
sudo reboot

This is only necessary when just performing restart. The IP configuration should always succeed after a reinstallation. Other operating systems are not affected either.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article

Modified on 25 Mar 2024

Can’t find what you’re looking for?

Get in Touch

Do you have a pre-sales question?