Home  >  Article  >  Operation and Maintenance  >  How to fix IP in centos7

How to fix IP in centos7

尚
Original
2020-03-30 15:37:376032browse

How to fix IP in centos7

centos7 sets the IP to a fixed value:

Recommended related video tutorials: linux video tutorial

Enter the IP of the system The directory where the address save file is located

[root@localhost ~]# cd /etc/sysconfig/network-scripts

Modify the file that saves IP information

[root@localhost ~]# vim ifcfg-eth0 (The name on your machine may not be this, but it is ifcfg -eth files)

How to fix IP in centos7

Save and exit

Restart the network

[root@localhost ~]# service network restart

Note: If your virtual machine is found I can't connect to the Internet. When I ping the fixed address, it appears: connect:Network is unreachable; and when I use the following command to check the IP, I find that the IP is not the fixed value you set.

[root@localhost ~]# ip addr

It is very likely that the local network card is not started. At this time we use the following command to start the network card.

[root@localhost ~]# ifup eth0

Recommended tutorial: centos tutorial

The above is the detailed content of How to fix IP in 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