No Internet connection after disconnecting from VPN in Ubuntu 18.04

It could be related to this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1778946

SOLUTION

Edit the file /etc/ppp/ip-up.d/0000usepeerdns

Replace the following line:

cp -a "$REALRESOLVCONF" "$REALRESOLVCONF.pppd-backup.$PPP_IFACE"

With this code:

cp "$REALRESOLVCONF" "$REALRESOLVCONF.pppd-backup.$PPP_IFACE"
chmod 644 "$REALRESOLVCONF.pppd-backup.$PPP_IFACE"

Restart the network manager:

systemctl restart NetworkManager

Try this, it worked for me.

Disconnect from VPN

sudo rm /etc/resolv.conf
sudo gedit /etc/resolv.conf

add: "nameserver 8.8.8.8" then save

sudo service network-manager reload

I had a similar but different problem. When my Debian 4.19.37-5+deb10u1 loaded, it started NordVPN Version 3.2.0-4 . Whenever I disconnected the VPN, I had no internet connection. Though, local network was still accessible and DNS returned the correct IPs when attempting an internet ping. NordVPN would not reconnect. My only option was to reboot.

None of the solutions presented previously worked for me. Not even restarting manually the network manager service.

I had to uninstall (purge) and reinstall NordVPN following those instructions: https://support.nordvpn.com/Connectivity/Linux/1322207652/Troubleshooting-connectivity-of-Linux-app.htm

Now, I can connect and disconnect NordVPN as much as I want and I have internet access as expected in both situations. Still works after reboot.