Virtual Machine VirtualBox + Centos + NAT network configuration process

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.