Friday, September 16, 2022

Ubuntu unable to connect to internet after recovering from hibernation with VPN connected

There could be many difference issues causing the network connection problem after hibernation. One possible issue I wanted to note down here is network mis-configuration by VPN. The VPN client will change the content in the network configuration file /etc/resolv.conf. The system should automatically restore the original configuration file after disconnecting from VPN. However, when putting the system into hibernation before disconnecting from VPN, the original configuration file won't be restored in some instances. As a result, when recovering from hibernation, the system has a mis-configured file /etc/resolv.conf so that it can not connect to or ping any website. To resolve the problem, look for a backup file for /etc/resolv.conf in folder /etc/ (list possible files by command ls /etc/resolv.conf*) and replace the mis-configured file with the correct version.