How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

WJ
Release: 2020-06-05 15:56:05
Original
9122 people have browsed it

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet?

In daily study, we often use virtual machines to test different systems. So after you install the CentOS7 virtual machine, you will be very depressed if you find that the virtual machine cannot access the Internet. Well, after all, there are many commands that need to be connected to the network to be implemented. If you cannot access the Internet, then of course you cannot fully test and learn the CentOS7 system!

The following will introduce to you a quick way to solve the problem of Internet access in CentOS7 virtual method

First: open the edit menu of the virtual machine and select "Virtual Machine Network Editor"

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Virtual Machine Network Editor

Select Restore Default Settings in the Virtual Machine Network Editor

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Next open the CentOS7 virtual machine Machine

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

It should be noted here that you must set up as an administrator, so you need to log in to the system as an administrator

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Then enter ls /etc/sysconfig/network-scripts in the opened terminal to view the network information of the virtual machine

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Then enter vi /etc/ in the terminal sysconfig/network-scripts/ifcfg-ensXXXX

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

At this time enter the reading mode of the network configuration file ifcfg-ensXXXX

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Then press the i key to enter text insertion editing mode.

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Focus on setting BOOTPROTO=dhcp and ONBOOT=yes.

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

After modification, press the Esc key first, then enter a colon (:), then enter wq, and finally press the Enter key to exit the vim editor

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Next, set the VMware DHCP Service and VMware NAT Service of the virtual machine in the physical machine and ensure that these two services are turned on. Create a new bat file, then run the batch file to open these two services

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Finally, restart the network service of the virtual machine and enter service network in the terminal of the virtual machine restart, press Enter to confirm restarting the network service!

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

The setup is basically over now, hurry up and try to see if you can get online

How to solve the problem that CentOS7 in the virtual machine cannot access the Internet

Related references:centOS tutorial



The above is the detailed content of How to solve the problem that CentOS7 in the virtual machine cannot access the Internet. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!