First edit the /etc/sysconfig/network-scripts/ifcfg-eth0 or ifcfg-ens33 file
vi /etc/sysconfig/network-scripts/ifcfg-eth0
or
vi /etc/sysconfig/network-scripts/ifcfg-ens33
and change the file, Change ONBOOT="no" to ONBOOT="yes"
Then press ESC, enter: wq to save and exit, restart the network card
service network restart
Finally enter again You can view the ip with the ifconfig command
Recommended tutorial: centos tutorial
The above is the detailed content of What should I do if I can't see the IP address on centos?. For more information, please follow other related articles on the PHP Chinese website!