Install CentOS6.4. the KVM is installed on it, and then the CentOS6.4 virtual machine is installed on KVM. The default Internet access mode for this CentOS6.4 virtual machine is NAT. Network configuration of the virtual machine: enter the terminal: # vim/etc/sysconfig/network-scripts/ifcfg-eth0 to change to: DEVICE = & rdquo; eth0 & Prime; BOOTPROTO = & rdquo; dhcp &
Install CentOS6.4. the KVM is installed on it, and then the CentOS6.4 virtual machine is installed on KVM. The default Internet access mode for this CentOS6.4 virtual machine is NAT. Network configuration of the virtual machine:
Enter the terminal:
# Vim/etc/sysconfig/network-scripts/ifcfg-eth0
To:
DEVICE = "eth0 ″
BOOTPROTO = "dhcp" # Note
HWADDR = "52 *****" # corresponding MAC address
NM_CONTROLLED = "yes"
ONBOOT = "yes" # Note
TYPE = "Ethernet"
UUID = "2ca *****"
Enter the terminal:
# Service network restart
If the VM still cannot access the Internet, but the domain name can be resolved, that is, ping baidu.com can resolve the problem but the IP address cannot be pinged, the hen does not forward the IP address. solution:
Enter hen:
Modify the parameters in/etc/sysctl. conf to allow ip forwarding:
# Vim/etc/sysctl. conf
To:
Net. ipv4.ip _ forward = 1. it takes effect permanently and needs to be restarted.
Or
Echo 1>/proc/sys/net/ipv4/ip_forward takes effect immediately.