Centos cannot access the Internet after configuring a static IP

王林
Release: 2020-04-03 14:04:07
Original
4361 people have browsed it

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
Copy after login

(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了
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!