Article Title: communication between Linux and host machines. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. cd/etc/sysconfig/network-scripts/
2. ls-a to view all files under the current directory; and cat ifcfg-eth0 to view ifcfg-eth0 content
3. there are only three simple lines in my ifcfg-eth0, no ip-related information, so edit the content, vi ifcfg-eth0, edit by insert, the Edit content is as follows (the first three rows are originally available ):
DEVICE = eth0 ONBOOT = yes BOOTPROTO = dhcp IPADDR = 192.168.1.101 NETMASK = 255.255.255.0 NETWORK = 192.168.1.0 BROADCAST = 192.168.1.255 GATEWAY = 192.168.1.1 # GATEWAYDEV = eth0
Then ESC exits the editing status, shift +: Enter wq to exit
4. in this case, you must restart the NIC: cd/etc/rc. d/init. d. Enter. /network restart:
"In the pop-up interface, eth0 is deciding the ip address of eth0... failed: no link. Check the cable ?"
In this case, you can change BOOTPROTO = dhcp to BOOTPROTO = static, and then repeat the above steps.
5. ifconfig: the modified ip address is displayed.
6. ping 192.168.1.100 (host machine ip address), OK!
7. ping 192.168.1.101 (VM ip) on the host machine. OK!