0

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

5
  • did you try Google Chrome? if it affects all browsers or only Firefox
    – JoKeR
    Jun 19, 2019 at 11:30
  • when you disconnect open terminal and type ping -c4 google.com if it prints out means you have internet connection the issue might be related to Firefox in this case.
    – JoKeR
    Jun 19, 2019 at 11:36
  • Thank you for a reply! No no, problem is with all internet, all browsers, not just Firefox. So, when disconnecting from vpn with command "nordvpn d", I have no internet. And as I said, killswitch is disabled. There is some bug in NordVPN program I gues, because commands "nmcli networking off && nmcli networking on" solve it. Now I just need to put these two commands in Alias to make it handy :)
    – user908975
    Jun 19, 2019 at 12:05
  • i guess your /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 run dhclient or dhclient -r && dhclient. Does this fix the connection? Jun 21, 2019 at 16:52
  • YES IT DOES! Thank you sir! :)
    – user908975
    Jun 21, 2019 at 21:23

0

You must log in to answer this question.