&http://www.aliyun.com/zixun/aggregation/37954.html ">NBSP; Implement communication between Linux and host hosts
1.cd/etc/sysconfig/network-scripts/
2.ls-a View all files in the current directory; and cat Ifcfg-eth0 view Ifcfg-eth0 content
3. My ifcfg-eth0 inside only a simple three lines, no IP-related information, so its content for editing, vi Ifcfg-eth0, press insert for editing, edited as follows (the first 3 lines are already there):
Device=eth0 onboot=yes bootproto=dhcp ipaddr=192.168.1.101 netmask=255.255.255.0 BR oadcast=192.168.1.255 gateway=192.168.1.1 #GATEWAYDEV =eth0
Then ESC exits the edit state, shift+: Enter Wq exit
4. Then use ifconfig to view IP or previous information, so you must restart the network card: CD/ETC/RC.D/INIT.D, input./network Restart Restart the network card The following error message appears:
"Pop-up interface eth0 is deciding eth0 IP information ... Failed: No link, check cable? ”
This problem, change the bootproto=dhcp to Bootproto=static, and then repeat the above steps.
5.ifconfig can see the modified IP information
6.ping 192.168.1.100 (host IP), ok!
7. Ping 192.168.1.101 (the IP of the VM) in the host, ok!