Successfully solved the problem that the virtual machine cannot be connected to the network again after being suspended for a long time, and it will prompt that the network activation failed (pro-test is effective!)
A virtual machine used to do blockchain has not been turned on for a long time, it has been in a suspended state, and it has been prompting that the activation of the network connection failed. Tried many methods but failed to solve the problem. Changing and closing the Ethernet, restarting the network card of the physical machine did not solve the problem very well. Finally, I tried my own method and successfully solved the problem!
solution:
My virtual machine is using NAT mode
First, open our VM virtual network editor
Click on the NAT setting to find its gateway. We also need to set up the network according to its gateway when using NAT mode.
The network card gateway address of VMnet8 we use here is 192.168.95.2
Then we click the small icon in the upper right corner to view the network status, then click the small icon of network connection,
wired settings - wired connection
Then we click on the network settings icon
Then we click IPv4 to change the automatic acquisition (DHCP) to manual, and manually set the ip based on the gateway 192.168.95.2, and also set the DNS resolution address, otherwise we will not be able to access the Internet. The DNS resolution address I set here is 8.8.8.8, you can also set a few more, just separate them with commas.
After setting, click Apply, and then you can restart the network card, or you can directly restart the virtual machine to reconnect to the network.
service network-manager restart
Or restart the virtual machine directly
reboot
It successfully shows that it has been connected, let's ping Baidu to try
Successfully pinged! Check our ip is also 192.168.95.159 we set
At the same time, it can also successfully open the web page and solve the problem successfully!
Hahaha, at the beginning I thought it was quite complicated. After referring to other bloggers' processing ideas and comparing my actual situation, I tried it myself and found that the problem is solved so simply, and there is no need to change so many configuration files like other bloggers. . It's really useful to try it myself, I hope it can help you too!