Lab environment: Window 7 (host) + centos 6.5 (virtual)
1.After a virtual machine is installed, it is often possible that the virtual machine cannot access the Internet (default: the host can access the Internet) and cannot communicate with the host. The situation is complicated! However, in general, Nic configuration is a problem.
Before configuring the NIC, it is necessary to understand what the NIC is doing? See the figure
2.The next step is to configure the NIC, follow me
(1)Is your Linux Nic started?
VI/etc/sysconfig/network-scripts/ifcfg-eth0 (Do not make a mistake. It is followed by 0, not O)
Ipaddr = 192.168.10.10 # IPAddress
Netmask = 255.255.255.0 #Mask Value
Network = 192.168.1.0 #Network Address (optional)
Broadcast = 192.168.1.255 #Broadcast address (optional)
Gateway = 192.168.1.1 #Gateway address
Onboot = yes # [Yes | no](Whether to activate the device during boot)
Userctl = No # [Yes | no](Can a non-root user control the device)
Bootproto = DHCP # [none | static | BOOTP | DHCP](No protocol used during boot | static allocation | BOOTP protocol | DHCP protocol)
Then restart the service network restart to take effect, or/etc/init. d/network restart to take effect.
If this screen appears, it is OK to start the NIC.
(2)Set Virtual Machine Nic
(3)Virtual Nic Configuration
(4)Test communication?
I'm glad to help you.