Sometimes it happens when I disconnect from a VPN that I can't connect to internet with my 'regular' connection any more. So I have to turn VPN on again in order to connect to internet. This problem sometimes lasts for several hours, but sometimes more days, and I can't figure out what is cause for this, since I never change my network settings.
Long story short, your Internet connection is intact and healthy. VPN could not work otherwise. Obviously, the application in charge does not always clean up properly when VPN connection is terminated.
You can try to restart networking and see if that restores original networking settings. Next to it, you can try to notice if VPN is disconnected some special way when such the problem occurs. (That is possible, that terminating VPN client directly instead of or before using menu 'disconnect' entry causes the problem.)
You are changing your network settings every time you connect or disconnect from your VPN; by whatever means you use to connect/disconnect your VPN settings.
You've not provided any Ubuntu MATE release details; but have you explored the issue?
ie. I'd constrast what it was before you connect to VPN (when working), when VPN is connected, plus when VPN disconnects (and its not working) for clues as to your issue.
Commands I'd likely use include
ip route
(look at your routing table)ping -c 1 [your ISP address]
(I can't know that, but I do know my own ISP's address; and here I'm not referring to the human name, but the actual numbers that your ISP uses.. mine is 203.(etc) for exampleping -c 1 [known external address]
, eg. a commonly used address maybeping -c 1 8.8.8.8
which is google; commonly used as the8.8.8.8
many (including myself) find easy to remember; the address itself only needs to be one that does reply to echo requestsping -c 1 [human.ip.address]
where this one will use DNS to convert the *human.form.ip.address to the actual address in web/number format; eg.ping -c 1 ubuntu.com
will convert to185.125.190.21
or equivalent (even if another server replies; it's not the address that's of interest; that it works or doesn't work is the clue I'm looking for; this conversion of human.ip.address to actual.ip.address is checking DNS is functioning)- etc.
Whatever changes would I'd hope let you know what your VPN configuration scripts is incorrectly handling, and thus what is required to make up for that (via script etc), though as @ugnvs already stated, restarting networking is a likely alternative anyway.
Of course I was trying with disconnecting and reconnecting, and with restarting the operating system, but it did not help.
I'd like to note that VPN
is a very broad and vague term. More to that, 'protected' connections can be implemented in many different ways. Provided that, I'd like suggest to consult with your VPN provider knowledge base and/or user forum.
It doesn't matter to which VPN I switch, the problem remains. I use Proton and Windscribe VPN.
- VPN's are rather touchy. Having two VPN clients installed may be the cause of trouble.
- It looks like the problem is known for Proton VPN at least.
https://forums.linuxmint.com/viewtopic.php?t=373930
https://forums.linuxmint.com/viewtopic.php?t=364199
https://www.reddit.com/r/ProtonVPN/comments/11sqo53/internet_connection_does_not_work_after_return/
I have no experience with Windscribe, but I have had a similar problem in the past with Proton VPN. It incorporates a function called a kill switch. From https://protonvpn.com/support/what-is-kill-switch/:
Our Windows and Linux apps now also feature a permanent kill switch. In addition to protecting you from accidental VPN disconnections, this prevents you from accidentally using the internet without the VPN turned on, and it will persist when you shut down and restart your device. You will not be able to connect to the internet if you manually disconnect the VPN without also disabling Permanent Kill Switch.
The linux Proton VPN version 4.8.2 settings dialog doesn't distinguish between a kill switch and a permanent kill switch, as far as I can tell. It only has a toggle switch for "Kill switch". You can only toggle that setting if the VPN is disconnected.
My experience in the past is that if a glitch happens when shutting off the VPN or shutting down the computer, sometimes the kill switch remains active, even if the VPN is not enabled. The next time this happens, try quitting (not just disconnecting) the Proton VPN app, and type this command in a terminal:
nmcli connection show
If the output contains a line like this:
NAME UUID TYPE DEVICE
...
pvpn-killswitch-ipv6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx dummy ipv6leakintrf0
...
then the kill switch (implemented as a network connection) was not properly terminated. If that's the case, terminate the connection by typing this command in a terminal:
nmcli connection delete xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx uuid
but you'll have to replace the string of x's with the actual uuid from the previous nmcli connection show
command.
Also, I agree with @ugnvs that it is begging for conflict to use more than one VPN. If you are using a browser that also implements what they claim is a "VPN" (really more like a proxy) you should consider shutting off the browser "VPN" while you are using Proton or another full-featured VPN.
If you confirm that your problem is an orphaned kill switch connection, and if you are not an at-risk vulnerable person (for example, a journalist or activist in a dictatorship), you could consider turning off the kill switch in the settings dialog.
You might also check that your Proton VPN app is up-to-date, and that you have added the Proton repository so that your vpn is updated regularly.
Hope this helps.