Home > Operation and Maintenance > CentOS > 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

王林
Release: 2020-04-04 11:20:14
Original
5304 people have browsed it

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

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

cd /etc/sysconfig/network-scripts/
Copy after login

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

ls
Copy after login

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

7. Ping Baidu test

ping www.baidu.com
Copy after login

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!

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 admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template