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)
7. Ping 192.168.1.101 (Vm IP) on the host)
If you think it is useful, please reply to a 1024 suggestion. Respect others' labor achievements.