The Virtual Machine VirtualBox + Centos + NAT network configuration process is followed by enabling the Virtual Machine Centos to access the Internet. It took a long time to split. Summarize the experience here. I chose the NAT network connection method. According to my understanding, the advantage of the NAT network connection mode is that it is convenient to configure. You do not need to manually set the IP address or so on, just get it automatically. Virtual machines can access the network. The Virtual Machine and the Host machine can also access each other. However, external websites cannot access virtual machines (disadvantages ). But it doesn't matter. It is a virtual machine used for practice. There is no need for external access. After CentOS is installed, go to the system. The network is not enabled yet. Use the following command to enable the network. Ifconfig eth0 up # enable the NIC (ifconfig eth0 down) ping g.cn # Or ping www. baidu. comifconfig eth0 up and then the Internet can be accessed normally. Ping the Internet to test. You can ping it. The next step is to automatically connect to the website each time Centos is started. See vi/etc/sysconfig/network-scripts/ifcfg-eth0DEVICE = "eth0" HWADDR = "08: 00: 27: BE: 80: a6 "NM_CONTROLLED =" yes "ONBOOT =" yes "BOOTPROTO =" dhcp "BOOTPROTO: sets the way for the NIC to obtain the IP address. Possible options include static, dhcp, or bootp, corresponding to the static IP address, IP address obtained through dhcp protocol, IP address obtained through bootp protocol. Reboot # After restart, the system can access the Internet normally.