Home >Operation and Maintenance >CentOS >Centos cannot access the Internet after configuring a static IP
Change the network connection to bridge mode in the virtual machine settings and check Copy the physical network connection status
Virtual Network Editor Restore the default settings in . If the settings are normal, there is no need to restore, just auto-bridging.
The host runs→cmd→ipconfig /all, check the IP address, subnet mask, gateway
##linux Entervim /etc/sysconfig/network-scripts/ifcfg-ens33(the last file depends on the actual situation, you can go to the previous folder and check ls)
BOOTPROTO=“static” ONBOOT=“yes” #如果你net模式可以联网,这个应该已经是yes了Add IP, Subnet mask, gateway. The IP is the same as the first three digits of the host, and the subnet mask and gateway are the same as the host. After completion: wq save and exit. Enter the command
systemctl retart network.serviceRestart the network
The above is the detailed content of Centos cannot access the Internet after configuring a static IP. For more information, please follow other related articles on the PHP Chinese website!