Home >Operation and Maintenance >CentOS >How to automatically obtain the IP address under centos7
Background:
I have just installed CentOS7. The minimum installation does not enable the network card to automatically obtain an IP.
Method:
To view the current network card information, use the nmcli command. There is no need to install net-tools. Use ifconfig. Of course, you can also use the ip add show command to view the ip address. Use the following command to view it. Information about the current network card. ens32 is the alias of the network card. Remember this alias.
nmcli device show
(Recommended tutorial: centos tutorial)
Look for the network card configuration file, find the file named ifcfg-ens32, edit this document.
Find the last line, ONBOOT=no
Set ONBOOT to yes and the IP address will be obtained automatically. After ESC, :wq save and exit.
Restart the network service. After restarting the network service, check the network card information and IP address again.
service network restart
Related video tutorial recommendations: linux video tutorial
The above is the detailed content of How to automatically obtain the IP address under centos7. For more information, please follow other related articles on the PHP Chinese website!