After installing CentOS7 with the virtual machine, it is not possible to surf the Internet, the following settings are required:
1. Set the virtual machine's network to bridge mode
2, modify the file/etc/sysconfig/network-scripts under the ifcfg-enp0s3 file, you may not be this file, but it's okay as long as the/ifcfg-exxx on the line
cd/etc/sysconfig/network-scripts/ // switch to this directory ls-a // View the file name in your machine VI ifcfg-enp0s3 // Modify this file to change onboot =no toOnboot=yes
3. Restart the Network Service
Service
4. See if you can connect
IP addr // view address ping www.baidu.com // can ping pass, description can be networked
5. Turn off the firewall
Systemctl Stop Firewalld.service // Stop firewallsystemctl disable Firewalld.service // Disable firewall boot firewall-cmd--state // View default firewall status (show notrunning after turn off, show running when turned on)
Linux Learning Note 1-CENTOS7 cannot be networked, shutting down firewalls