Ping www.baidu.com unknown domain name Modify the host ip address Right click properties Select Attributes This option was originally obtained automatically and may change later, so choose a fixed IP. This IP is obtained by entering ipconfig in the cmd window of the win10 host: It is said on the Internet that the IP address in the virtual machine must be consistent with that of the physical host, but mine is indeed not consistent. Virtual machine network configuration Open the Virtual Network Editor. The IP address filled in the first place should be consistent with the win10 host configuration above. The fourth field is filled with 0, otherwise it conflicts with the mask. The fourth field of subnet gateway (DNS) can be filled with 1 or 2. Select DHCP. Finally confirmed. Configure ifcfg-ens33 \ eth0 network card At first, my network card was ens33 (centos7's network card starts with ens, and centos6's network card starts with eth). Due to vcs license issues, I changed its name to eth0. Notice! If you use the eth0 network card, be sure to mv the ens33 network card to other files, because these files will be traversed when the system starts. As a result, if ipaddr0 is configured in ens33, this ipaddr0 will be used first; finally, you will see the metaphysical phenomenon of eth0's ipaddr=ipaddr0 in ifconfig. There is no need to manually add any ipaddr, mask, or gateway addresses here! ! ! (I added it, but it was not used in the end) If ipaddr is not filled in, the system will assign ipaddr=169.254.199.128 by default, which is assigned by DHCP. Ping this ipaddr, and you can receive data, indicating that the ip is usable Ping the subnet gateway (DNS), and you can receive data, indicating that DNS is available. However, after configuring the virtual machine, the DNS often cannot be pinged and needs to be restarted/rebooted. The reason is that the /etc/resolv.conf file has not been updated and is still the previous DNS. The picture below shows the file after restart. You can see that the DNS has been updated. Ping this dns passed. ping www.baidu.com Ok, you can go online now! Of course, you don't have to restart, but there will be more steps, which I will not go into here. This is the end of this article about how to solve the problem of centos7 being unable to access the Internet after modifying the network card. For more relevant content about centos7 being unable to access the Internet, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: HTML code to add icons to transparent input box
>>: HTML+CSS to achieve simple navigation bar function
When displaying long data in HTML, you can cut off...
In previous development, we used the default attr...
Preface The mv command is the abbreviation of mov...
1. Download Dependency npm install @antv/data-set...
First download the dependencies: cnpm i -S vue-uu...
Document Scope This article covers mode switching...
Recently, I have a project that requires using ifr...
Preface In fact, the humble "!" has man...
The questions encountered in Baidu interviews nee...
1. Installation environment 1. HUAWEI mate x cpu ...
This article shares the specific code of JavaScri...
Since its release in 2013, Docker has been widely...
Table of contents Overview Solution 1: Closures S...
Table of contents 1. MySQL replication process 2....
Preface When a 403 cross-origin error occurs No &...