How to solve the problem that centos cannot obtain IP?
Many times, after installing in the virtual machine, go into centos and use ifconfig to find that there is no such command. You can use ip a to check the IP.
If there is no ip, usually centos The default installation does not enable the network card. Solution:
CentOS configures the network card to automatically obtain an IP address upon startup.
Open /etc/sysconfig/network-scripts/ifcfg-eth0
WillONBOOT=”no”
Change to ONBOOT=”yes”
After saving:
systemctl restart network
This problem can be solved
Related Reference: centOS Tutorial
The above is the detailed content of How to solve centos cannot obtain ip. For more information, please follow other related articles on the PHP Chinese website!