Home  >  Article  >  Operation and Maintenance  >  How to solve the problem that centos cannot access the Internet under the virtual machine

How to solve the problem that centos cannot access the Internet under the virtual machine

王林
王林Original
2020-04-04 11:20:145275browse

How to solve the problem that centos cannot access the Internet under the virtual machine

1. First, ensure that the network adapter of the virtual machine is in NAT mode.

How to solve the problem that centos cannot access the Internet under the virtual machine

2. Set the "Edit" of the virtual machine-- 》In the "Virtual Network Editor", both options of VMnet8's DHCP settings are checked

How to solve the problem that centos cannot access the Internet under the virtual machine

3. Set the physical host and ensure that the IP address of the virtual gateway is automatic. Obtain; at the same time, the local connection is also set to automatically obtain

4. Enable the VMware DHCP Service and VMware NAT Service of the physical host. The command is

net start "VMware DHCP Service" 
net start "VMware NAT Service"

5. CentOS does not start the network card by default and needs to be manually Start

cd /etc/sysconfig/network-scripts/

Check what the corresponding number is after ifcfg-eno, take eno32 as an example

ls

Switch to the root user, vi ifcfg-eno32, edit the file

Set ONBOOT=yes

That is to say, automatically enable the network connection

:wq Save and exit.

6. In the virtual machine environment, restart the network, the command is

service NetworkManager stop
service network restart
service NetworkManager start

7. Ping Baidu test

ping www.baidu.com

How to solve the problem that centos cannot access the Internet under the virtual machine

## Related tutorials Recommended:

centos tutorial

The above is the detailed content of How to solve the problem that centos cannot access the Internet under 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