How to modify the IP after copying someone else's virtual machine

Recently, I was working on a learning online project. I copied the virtual machine provided by the teacher directly. It turned out that it was a static IP, which was different from the default dynamic IP in the past. I couldn’t connect to it with xshell. Instead of changing the static IP to a static IP, change the static IP back to the default dynamic IP, and finally ensure the connection.

First enter the network configuration file with the following command:

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

Then you can see the corresponding network configuration.

 Then modify the configuration file of centos that you created before.

Mainly to modify the following parts:

 It can be modified as follows.

After the modification is complete, restart the network configuration:

systemctl stop NetworkManager
systemctl restart network

Finally, you can ping through. 

Guess you like

Origin blog.csdn.net/loveSIYU/article/details/130700242