Home  >  Article  >  Operation and Maintenance  >  Centos cannot access the Internet in the virtual machine

Centos cannot access the Internet in the virtual machine

王林
王林Original
2020-03-18 11:55:452532browse

Centos cannot access the Internet in the virtual machine

First, enter the /etc/sysconfig/network-scripts/ directory:

Command:

cd /etc/sysconfig/network-scripts

Centos cannot access the Internet in the virtual machine

Then check ifcfg-ens33 in the file in the directory. It is usually this one. Some people may have other numbers. Open it for editing through the vim command:

(Recommended tutorial: centos use Tutorial)

Command:

vim ifcfg-ens33

Centos cannot access the Internet in the virtual machine

At this time, enter the vim editing content, change ONBOOT=no to ONBOOT=yes, and then Save and exit:

Centos cannot access the Internet in the virtual machine

#Finally enter the command service network restart in the terminal to restart the network service.

Command:

service network restart

Centos cannot access the Internet in the virtual machine

Related video tutorial recommendations: linux video tutorial

The above is the detailed content of Centos cannot access the Internet in the virtual machine. 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