Home  >  Article  >  Operation and Maintenance  >  How to automatically obtain the IP address under centos7

How to automatically obtain the IP address under centos7

王林
王林Original
2020-03-30 14:57:394817browse

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

How to automatically obtain the IP address under centos7

(Recommended tutorial: centos tutorial)

Look for the network card configuration file, find the file named ifcfg-ens32, edit this document.

How to automatically obtain the IP address under centos7

Find the last line, ONBOOT=no

How to automatically obtain the IP address under centos7

Set ONBOOT to yes and the IP address will be obtained automatically. After ESC, :wq save and exit.

How to automatically obtain the IP address under centos7

Restart the network service. After restarting the network service, check the network card information and IP address again.

service network restart

How to automatically obtain the IP address under centos7

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn