Have to say, to Linux must have the spirit of play, various tests, finally solve the problem, or did not solve the problem. Although not resolved, but the understanding of the problem deepened, one day to try again, it may be solved. In the jargon, it is not the time to report.
Choose CentOS
There was no success here, and now look back,
PC Ping CentOS OK,
CentOS Ping pc Notok,
It is likely that the PC's firewall is not shutting down. Overall, the personal experience of CentOS's network setup is more complex than Ubuntu.
Embracing Ubuntu
Static settings
1. Locate the file and make the following changes:
sudo vim/etc/network/interfaces
Modify the following sections:
Auto Eth0
Iface eth0 inet Static
Address 192.168.0.117
Gateway 192.168.0.1 #这个地址你要确认下 Gateways are not this address
Netmask 255.255.255.0
Network 192.168.0.0
Broadcast 192.168.0.255
2. Modify DNS Resolution
DNS server addresses are automatically assigned because they were previously resolved by DHCP
And once the static IP is set, there is no automatic access to the DNS server.
To set a
sudo vim/etc/resolv.conf
Write the DNS on a public network
NameServer 202.96.128.86 #这里可以用ipconfig/all View the DNS address of the PC
(Note: 8.8.8.8 is Google's DNS server, but the resolution is slow, or to find a domestic DNS to use)
3. Restart the network card:
Sudo/etc/init.d/network restart
Use Ifconfig to view, if not effective, can be directly reboot.
One-way Ping pass
At this point, the PC pings the virtual machine OK. The virtual machine ping pc failed. After shutting down the firewall on the PC, it succeeds.
Sisu Network Direct Ping www.baidu.com, failed, should be DNS file configuration is not correct, supplement the effective server.
Install Ssh-server, ssh-client
Apt-get Update
Apt-get Install Openssh-server
Note You may encounter a version mismatch error that requires a version number to be added to the installation command.
A Linux virtual machine on the Internet set up the whole process