How to fix IP in centos7

Release: 2020-03-30 15:37:37
Original
5841 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!