Home >Operation and Maintenance >CentOS >Centos cannot access the Internet after configuring a static IP

Centos cannot access the Internet after configuring a static IP

王林
王林Original
2020-04-03 14:04:074478browse

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

Centos cannot access the Internet after configuring a static IP

Virtual Network Editor Restore the default settings in . If the settings are normal, there is no need to restore, just auto-bridging.

Centos cannot access the Internet after configuring a static IP

The host runs→cmd→ipconfig /all, check the IP address, subnet mask, gateway

Centos cannot access the Internet after configuring a static IP

##linux Enter

vim /etc/sysconfig/network-scripts/ifcfg-ens33

(the last file depends on the actual situation, you can go to the previous folder and check ls)


Change

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.service

Restart the network


Recommended related tutorials:

centos tutorial

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn