Solution to ping the vmvm CentOS System in win
Incident Description: The company migrated the new site. After the computer was taken over, the centos system connected to the vm using xshell always failed to connect. Then, considering the new site migration situation, I first suspected that it was an ip address problem, then, execute ifconfig In the vm to find the centos ip address and run the ping command in the middle of windows. If you do not, the ping will fail.
Cause Analysis: because I don't have much access to linux, I usually use it for testing. Therefore, in the face of this problem, I cannot analyze the cause myself, baidu: After the ip address is changed, the vm ip address and windows ip address may not be in the same network segment, which leads to connection failure.
Solution: The cause is that the ip address is not in the same CIDR block, and the solution is simple. configure it to the same CIDR block. For example, if my centos ip address is 192.168.1.110 and windows ip address is 192.168.10.11, then I can change the centos ip address to 192.168.10.X (X represents a number ranging from 0.
RunIpconfigFind the windows ip address and executeVi/etc/sysconfig/network-scripts/ifcfg-eth0Modify the NIC configurations. Save and exit, and runService network restartThe new Nic configuration takes effect. Then, run the ping command again in windows to test the configuration.