After CentOS7 set static ip, unable to ping the external network problem

  • VM and CentOS7 installation reference: VM15 installation , CentOS7 installation

  • When we install CentOS7, we need to assign an ip to the system, enter root privileges, and dhclientdynamically assign an ip address to the linux system; but this is only a dynamic assignment, and the ip will be unavailable after the next startup. This ip needs to be statically set to this system;

To set the static ip, first enter to vi /etc/sysconfig/network-scripts/ifcfg-ens33edit the file, and modify it as follows:

Insert picture description here
If the gateway address is configured incorrectly, the centos system will not be able to access the external network;

注意: After modifying the above file, to restart the network, commandsystemctl restart network.service

Insert picture description here
Click virtual machine edit
Insert picture description here

At this time, you can Ping the external network address
Insert picture description here

Restart the network card and report Job for network.service failed because the control process exited with error code reports an error 解决

[root@mina0 hadoop]# systemctl stop NetworkManager
[root@mina0 hadoop]# systemctl disable NetworkManager

Guess you like

Origin blog.csdn.net/m0_37989980/article/details/107231977