I am using NordVPN and for it a dedicated terminal program. I have made two .desktop alias to connect to vpn and to disconect.
Fist one is to connect to US server:
[Desktop Entry]
Name=NordVPN c us
Exec=nordvpn c us
Terminal=true
Type=Application
Second is to disconnect from vpn:
[Desktop Entry]
Name=NordVPN d
Exec=nordvpn d
Terminal=true
Type=Application
Both work great and fast. But lately I am having problems with the second alias (to disconnect). When I click on disconnect alias, it disconnects from vpn, but internet is disabled. I mean tray icon shows like internet is up, but when I go to Firefox, I cannot open websites. Solution for this is to disconect from internet in upper right corner (disable wired connection) and then connect.
So I thought I would make another alias for disconnecting from vpn:
[Desktop Entry]
Name=NordVPN d
Exec=nordvpn d && nmcli networking off && nmcli networking on
Terminal=true
Type=Application
...But it does not work. If I type in terminal these 3 lines in terminal it works, but together in alias it does not work:
nordvpn d
nmcli networking off
nmcli networking on
I think the problem with this multiple alias is that each seperate command needs few seconds to take action, but the following one does not wait. Would it be possible to set some delay between them or something like this? I have tried seperating them with ; and with && but problem stays the same.
I have tried adding delay in alias, but no luck (also tried with ; insted of &&):
Exec=nordvpn d && sleep 5 && nmcli networking off && sleep 5 && nmcli networking on
Please help me solve this problem. Thank you :) I am using ubuntu 18.04
ping -c4 google.com
if it prints out means you have internet connection the issue might be related to Firefox in this case./etc/resolv.conf
is not updated when you disconnect from the vpn with the result leaving your dns setting in a bad state. Have you tried to rundhclient
ordhclient -r && dhclient
. Does this fix the connection?