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