Quickly solve the problem that CentOS cannot access the Internet in VMware

Quickly solve the problem that CentOS cannot access the Internet in VMware

Yesterday I installed CentOS7 under VMware. I wanted to use ftp to transfer the tomcat package, but I found that ftp was not installed. I used the " yum -y install vsftpd " command to install it, but it prompted that I had no network! ?

At first I thought it was a problem with the mirror server, but after pinging it I found that I couldn't connect to the network at all. Since many settings are default, and the virtual machine is also in default NAT mode, sharing the network with the host computer, it should not be a problem with VMware settings. After consulting a lot of information on the Internet, the final cause turned out to be the default installation. The specific solution is as follows:

Enter the network configuration cd /etc/sysconfig/network-scripts scripts

List directory contents: ls (L next to K, not 1 or i)

Then check the files in the directory and find an ifcfg-ens33 . Usually it is ifcfg-ens33 . The "33" after "ens" may be other numbers in different environments.

Use the "vi" command to open for editing: vi ifcfg-ens33

Note: Most tutorials on the Internet use the "vim" command for editing. During the test, I found that "vim" was not installed. When I looked for tutorials on how to install "vim", I still had to download it online, so I used the "vim" command here.

A long string of English will appear, but it is enough to understand the last line. It will prompt us to press Enter to continue. Just press "ENTER"

Now the cursor is positioned on the last line, change ONBOOT=no to ONBOOT=yes

Enter the command: :wq to save

The system will recognize the " :wq " entered in input mode as text. Press "ESC" to switch modes first, then enter: :wq to save

Finally, enter the command: service network restart service network restart .

Summarize

The above is the quick solution to the problem that CentOS cannot access the Internet in VMware introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Solution to the problem of not being able to access the Internet when installing centos7 with VmWare
  • Solution to the problem that CentOS installed on VMware virtual machine cannot access the Internet

<<:  A brief analysis of the knowledge points of exporting and importing MySQL data

>>:  Detailed explanation of the differences between js array find, some, filter, and reduce

Recommend

Markup Language - Anchor

Previous: Markup Language - Phrase Elements Origin...

Solution to the error in compiling LVGL emulator on Linux

Table of contents 1. Error phenomenon 2. Error An...

Using jQuery to implement the carousel effect

This article shares the specific code for impleme...

Detailed explanation of generic cases in TypeScript

Definition of Generics // Requirement 1: Generics...

Recommended plugins and usage examples for vue unit testing

Table of contents frame First-class error reporti...

How to run Hadoop and create images in Docker

Reinventing the wheel, here we use repackaging to...

HTML basics - CSS style sheets, style attributes, format and layout details

1. position : fixed Locked position (relative to ...

Docker custom network container interconnection

Table of contents Preface –link Custom Network As...

Understanding of haslaylout and bfc parsing

1. haslayout and bfc are IE-specific and standard ...

MySQL and MySQL Workbench Installation Tutorial under Ubuntu

Ubuntu install jdk: [link] Install Eclipse on Ubu...

MySQL grouping queries and aggregate functions

Overview I believe we often encounter such scenar...

MySQL 8.0.20 installation and configuration tutorial under Docker

Docker installs MySQL version 8.0.20 for your ref...

Summary of shell's method for determining whether a variable is empty

How to determine whether a variable is empty in s...

Windows Service 2016 Datacenter\Stand\Embedded Activation Method (2021)

Run cmd with administrator privileges slmgr /ipk ...

Extract specific file paths in folders based on Linux commands

Recently, there is a need to automatically search...