A move to solve ------ VMware virtual machine Centos7 network configuration ping: www.baidu.com: Unknown name or service not ping

A move to solve ------ VMware virtual machine Centos7 network configuration ping: www.baidu.com: Unknown name or service not ping

1. First, click on the VMware edit, then click the virtual network editor.

2. After entering the Virtual Network Editor click VMnet8, and click Change settings,

 

3. Re-enter the virtual network editor to edit the interface, and then click Restore Defaults

 

4. Then enter your virtual machine, enter the directory / etc / sysconfig / network-scripts, editing with vi or vim first file, and here I file named ifcfg-eno16777736, we may not have, according to their own files enter the name,

BOOTPROTO="static"

IPADDR = 192.168.96.11 (IP where IP is your virtual machine)

GATEWAY = 192.168.96.2 (this is the gateway)

NETMASK=255.255.255.0

DNS1 = 8.8.8.8

DNS 2 = 8.8.4.4

Once saved, you can restart the network: service network restart

The ping outside the network want to modify vi /etc/resolv.conf

Add to

nameserver 8.8.8.8

nameserver 8.8.4.4

Save it

Then ping www.baidu.com displayed as shown, to the ping.

 

 

6. hopes to communication between the virtual machine and windows, found on the windows VMnet8

 

 

 

 

Right VMnet8, click Properties to enter the interface as shown below, find IPv4, double-click to enter the interface shown on the right, click Use the following IP address, IP address, in addition to IP address of the virtual machine and your IP gateways, just write a Since my virtual machine gateway IP address 192.168.96.2, here I enter the IP address in the gateway IP. 

 

 

 

 

 

 

7. Locate the hosts file windows as follows path, open a text editor

 

Fill shown below the IP address and host name, save it

 

 

Then open cmd, ping master, through the domain name can be mapped to your virtual machine to ping

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/zhangchenchuan/p/11887801.html