Crawl pit notes --- VM virtual machine ping nowhere Baidu, but can ping each other and the host

Recommended two blog posts, inspired  https://blog.csdn.net/xinwenhuayu/article/details/82966724

                                        http://www.linuxidc.com/Linux/2016-09/135521p2.htm

 

 

First, understand what NAT mode

He is a virtual model of the network, including virtual switch VMnet8, virtual and virtual DHCP and NAT devices

On the host network adapter as well as VMware Network Adapter VMnet8, this is actually a communication port, not really the card, ip ip with his host are not the same, it means the virtual furnishings.

 

Here to talk about modifying iP

After switching to root

cd /etc/sysconfig/network-script

Inside find first file ifcfg-ens33 vim ifcfg-ens33

 

 

There is a need to set the VMware Network Adapter network segment ip VMnet8, I am here 192.168.2.X

bootproto = static static meaning (originally DHCP)

 

Next: vim /etc/resolv.conf

Add the following in the Rong

  search localdomain                                                          
  nameserver 8.8.8.8                                                          
  nameserver 8.8.4.4

 

 

Now restart /etc/init.d/network restart

ping  www.baidu.com

Is not pass it, happy cutting?

Leave me a message in question

Guess you like

Origin www.cnblogs.com/lisantao/p/11626731.html