CentOS between Windows host and virtual machine "ping nowhere"

Why should you encounter this problem

This is a problem I encountered after reinstalling centOS7.5 VM - I need to install a SecureCRT tool, the results of host and virtual machine does not ping each other.

Before you install this tool needs to ping each host and the virtual machine, so the next step requires a number of network-related configuration is complete.

Virtual machine ifconfig View card information

First, open a terminal and enter Vmware: ifconfig or ifconfig ens33 , you can see inet , Netmask , Broadcast , respectively, is how much.

 

inet windows terminal ping virtual machine

 

Open cmd command window on the windows system ping 192.168.159.31   If the "TTL = number", the representative can ping; If you see "unreachable The" (unreachable), the representative can not ping.

 

View windows on the wireless LAN adapter WLAN information

 In the windows of the terminal input: ipconfig  find ipv4 in the wireless LAN WLAN, my ipv4 address 192.168.43.61

 

 

ipv4 terminal ping windows on a virtual machine

Back to the virtual machine terminal the ping 192.168.43.61   "Time = xxms" ending up on behalf of, otherwise it will show "unreachable", by ctr + z to end

 

As a result, between the host and the virtual machine to ping each other, both sides need to ping the job. If the ping is not successful, there may have still not perfect, need to view and edit.

Here is the network configuration for host and virtual machines.

The virtual machine network configuration

First came to the workstation vmware virtual machine (this time my host attached to the phone's wifi). Click Edit> to open the Virtual Network Editor> find Vmnet8 (NAT mode)

There subnet IP, subnet mask, which belong to the workstation's default settings. If the virtual machine uninstalled, or turn over the subnet and subnet mask , you may need to click the bottom left corner to restore the default settings , network settings before the ping nowhere and probably does not match the current virtual machine. I restore the default settings before encountered such a problem, making it impossible to ping between host and virtual machines.

Note: The current IP subnet as: 192.168.159.0  Subnet Mask: 255.255.255.0

 

 

Select NAT mode

Next Point VM>> Network Adapter NAT mode is selected, i.e. is selected Vmnet8 (NAT mode)

 

 

 

 

 

VMware Network Adapter VMnet8 property is set on windows

windows host> Network and Sharing Center> Change adapter settings

 

The property is set to IPV4 Vmnet8

You can see Vmware Network Adapter Vmnet8, right> Properties> Internet Protocol Version 4 (TCP / IPV4)

From the previous virtual network editor learned Vmnet8 default subnet IP is: 192.168.159.0

In order to control the Vmnet8 ip ip and subnet in the same network segment where the IP can fill in: 192.168.159.1 Subnet Mask: 255.255.255.0  Default Gateway: 192.168.159.2 

 

 Corresponds Vmnet8 (NAT mode) on the virtual machine configuration as shown below:

 

 

Default Gateway needs and subnet ip and IP addresses defined in the same network segment that is 159 . If there is such a different prompt:

 

Finally, click OK, and make sure the status of the network adapter to start . However Vmnet1 attributes and status can be completely ignored, NAT mode nothing to do with it.

View and modify the ens33

Then back to the virtual machine enter:

查看:cat /etc/sysconfig/network-scripts/ifcfg-ens33

或者:vim /etc/sysconfig/network-scripts/ifcfg-ens33

After entering the command to see ipv6 , ipv6 These can be ignored, it is currently unavailable. ens33 --en the Ethernet, s represents hot-plug slot. Unlike traditional eth0, eth1, eth2, CentOS7 provides this different nomenclature, this nomenclature assigned based on firmware, topology, position information, its benefits are fully automatic naming, regularly.

ens33 card configuration information:

 

 

Modify the configuration ens33

In vim state; you can point "i" modified

You need to add / modify attributes are:

GATEWAY=192.168.159.2

NETMASK=255.255.255.0

DNS=192.168.159.2

ONBOOT=yes

Which BOOTPROTO = none

IPADDR=192.168.159.31

ens33 NIC configuration text (ibid.):

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=none

DEFROUTE = yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE = yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=ens33

UUID=dd53a6a3-8c67-4ce9-8dac-a3d088e99c6c

DEVICE=ens33

IPADDR=192.168.159.31

PREFIX=24

IPV6_PRIVACY=no

 

GATEWAY=192.168.159.2 

NETMASK=255.255.255.0

= 114.114.114.114 the DNS1    # (You can configure --DNS1 / DNS2 / DNS3, the need for digital note DNS)

ONBOOT=yes

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After modifying the need to save: the Esc> the Shift:!> WQ> the Enter  

Then execute the command: Service Network restart  then can look at whether the DNS server to resolve the relevant configuration file content has changed cat /etc/resolv.conf

 

 

See nameserver match can be, "yz" is my virtual host name. 114.114.114.114 is a DNS (Domain Name Server), domestic mobile, telecommunications, Unicom universal "Domain Name Server", of course, something else can be configured as DNS 8.8.8.8.

We can also look at Baidu ping  ping www.baidu.com   the DNS domain name will be resolved.

 

 Troubleshoot "no ping links"

The ping fails, look at windows and linux virtual machine if their firewall is turned off.

There is my issue: the need to Virtual Network Editor to restore the default configuration .

If you still can not ping, you need to troubleshoot this:

1 ping virtual machine Gateway

ping 192.168.159.2 

 

2 ping windows host gateway

ping 192.168.43.1

 

3 Look DNS DNS server is valid, invalid replace

nslookup

 

 

 Well, that is about the windows hosts and virtual machines between ip network configuration "relevant records and part of the solution not ping method", and want to help you, welcome valuable advice ...

 

Guess you like

Origin www.cnblogs.com/timingstarts/p/12553131.html