Solution to the problem of CENTOS7 unable to surf the Internet under VM virtual machine

Source: Internet
Author: User

Bloggers in the spirit of learning to install a CENTOS7 on the virtual machine to knock the command line. At first, we met with strong resistance ...

Ifconfig vim is useless. How can this be done, installation chant. Also learned lap installation, yum command.

As a result, Yum also does not perform. Could not find mirrirhttp * * * * * * et cetera. This is the reason why you can't surf the internet.

Further troubleshooting. On the internet said/etc/sysconfig/network-scripts/ifcfg-eth0 how to set the success. There is no such file at all. Add it manually or not. (later know because it is in the virtual machine)

There are 8 settings for DNS. 8. 8. 8 Wait, I have tried, it is no effect.

Also useful for IP addr to view the network card physical address. And then how to modify and so on.

Others say that setting up a virtual machine network connection is all about bridging. (later I messed up, only restore the virtual machine default network settings)

Basically this kind of online material a lot.

At last

Under the network connection of the virtual machine for NAT (that is, the default). Because I install it all the way by default, install the centOS7, minimize the installation.

The CENTOS7 is minimized in the virtual machine and cannot be connected to the Internet because the CENTOS7 default NIC is not activated .

can set

File/etc/sysconfig/network-scripts/ifcfg-enp0s3 (here the ENP0S3 is not fixed, depending on your situation, but basically the beginning of en)

Change Onboot=no to Onboot=yes

Restart NIC after saving: Service network restart

The Internet is available at this time. (if not, I suggest that you try what I'm starting with, because I've done a lot of things before, and the variables are not controllable.) There may be some steps in front of the successful part)

Because it is a minimized installation, the Ifconfig command is not available at this time.

Command: IP addr To view the allocation of NIC.

To run commands after networking:

Yum Install Net-tools

To install the Ifconfig feature

Hope to help some people, write very messy.

Solution to the problem of CENTOS7 unable to surf the Internet under VM virtual machine

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.