Internet connection only work when i use VPN

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
thealchemist80
Level 1
Level 1
Posts: 9
Joined: Mon Aug 29, 2016 4:23 am

Internet connection only work when i use VPN

Post by thealchemist80 »

Hi, i was wondering if anyone could help.

I am using Linux Mint Sarah Cinnamon 18. I can connect to the Internet fine. And when i install Tor-guard for Linux and connect to the Internet via my VPN it works fine too.

But once i disconnect from my VPN and close tor-guard, and reset or restart my laptop. I can no longer access the internet. It connects to my wifi but no data.

Then once i connect to the VPN again it works fine.

Does anyone know why i cant get any data on the internet when i am NOT connected to my VPN?

Thanks in advanced if anyone can help
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
thealchemist80
Level 1
Level 1
Posts: 9
Joined: Mon Aug 29, 2016 4:23 am

Re: Internet connection only work when i use VPN

Post by thealchemist80 »

Solved, sort of:

For anyone facing this issue i believe it is a DNS problem. Once you close your VPN client and lose Internet data you can type the following:

sudo sh -c "echo nameserver 8.8.8.8 > /etc/resolv.conf"


a better explanation at:

http://askubuntu.com/questions/249203/w ... v-conf-do/


Worked for me anyway. I guess its something i will have to do each time i want to stop using my VPN. Im fairly new to Linux but maybe someone might know why this line of code would be necessary :)
thealchemist80
Level 1
Level 1
Posts: 9
Joined: Mon Aug 29, 2016 4:23 am

Re: Internet connection only work when i use VPN

Post by thealchemist80 »

The good news in resolv.conf keeps the 'nameserver 8.8.8.8' in that file permenantly. So when i connect to the VPN it adds some stuff, but when i disconnect the VPN i am just left with nameserver 8.8.8.8.

Seems to work
phd21
Level 20
Level 20
Posts: 10104
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Internet connection only work when i use VPN

Post by phd21 »

Hi "thealchemist80",

Welcome to the wonderful world of Linux Mint and its excellent forum !

It would help to know more about your system setup. If you run "inxi -Fxzd" from the console terminal prompt, highlight the results, copy and paste them back here, that should provide enough information.

Thanks for the information on your situation and the work around.

A few observations:

What VPN provider are you using? How do you have that setup through the Network Manager in the system panel, or the console terminal, and what VPN protocol are you using "openVPN" TCP or UDP?

Why are you using "tor-guard" with a VPN? You could just use the "Tor Browser Bundle".

Your updating your default DNS IP servers with the default Google DNS server IP addresses, is that what you want?
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
thealchemist80
Level 1
Level 1
Posts: 9
Joined: Mon Aug 29, 2016 4:23 am

Re: Internet connection only work when i use VPN

Post by thealchemist80 »

Hi, thankyou for taking the time to respond.

I originally signed up for Torguard VPN while i was using Windows. It is using UDP. I mainly used it when using torrents for anonymity. I found out Torguard has an app/program for linux debian packages, so i installed it on this system. All was working fine except that it overwrites my resolv.conf name server to some adresses associated with the VPN. But when i was closing the TorGuard program i had no data transfer.

I do not want to update it with google DNS but it was the only way my internet would work after closing the VPN program provided by Torguard.

I have used the tor browser bundle before, and i do occasionally, but i was under the impression that it was only anonymous for browsing while using Mozilla?

Is using TorGuard VPN pointless? I do not do anything sinister on my PC but i do like to keep my IP disclosed when on-line all the same, especially if using torrents. My System details are below. Any suggestions would be appreciated, and thanks again.




System: Host: anon-ThinkPad-X1-Carbon Kernel: 4.4.0-21-generic x86_64 (64 bit gcc: 5.3.1)
Desktop: Cinnamon 3.0.7 (Gtk 3.18.9-1ubuntu3.1)
Distro: Linux Mint 18 Sarah
Machine: System: LENOVO (portable) product: 34486T7 v: ThinkPad X1 Carbon
Mobo: LENOVO model: 34486T7 v: 0B98405 Std
Bios: LENOVO v: G6ET96WW (2.56 ) date: 04/29/2013
CPU: Dual core Intel Core i5-3337U (-HT-MCP-) cache: 3072 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 7183
clock speeds: max: 2700 MHz 1: 897 MHz 2: 894 MHz 3: 827 MHz
4: 820 MHz
Graphics: Card: Intel 3rd Gen Core processor Graphics Controller
bus-ID: 00:02.0
Display Server: X.Org 1.18.3 drivers: intel (unloaded: fbdev,vesa)
Resolution: 1366x768@60.07hz
GLX Renderer: Mesa DRI Intel Ivybridge Mobile
GLX Version: 3.0 Mesa 11.2.0 Direct Rendering: Yes
Audio: Card Intel 7 Series/C210 Series Family High Definition Audio Controller
driver: snd_hda_intel bus-ID: 00:1b.0
Sound: Advanced Linux Sound Architecture v: k4.4.0-21-generic
Network: Card: Intel Centrino Advanced-N 6205 [Taylor Peak]
driver: iwlwifi bus-ID: 03:00.0
IF: wlp3s0 state: up mac: <filter>
Drives: HDD Total Size: 128.0GB (15.0% used)
ID-1: /dev/sda model: SanDisk_SD5SG212 size: 128.0GB
Optical: No optical drives detected.
Partition: ID-1: / size: 18G used: 5.7G (34%) fs: ext4 dev: /dev/sda1
ID-2: /home size: 92G used: 4.9G (6%) fs: ext4 dev: /dev/sda6
ID-3: swap-1 size: 8.27GB used: 0.00GB (0%) fs: swap dev: /dev/sda5
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors: System Temperatures: cpu: 47.0C mobo: N/A
Fan Speeds (in rpm): cpu: 1713
Info: Processes: 202 Uptime: 2:08 Memory: 1029.6/7684.4MB
Init: systemd runlevel: 5 Gcc sys: 5.4.0
Client: Shell (bash 4.3.421) inxi: 2.2.35
phd21
Level 20
Level 20
Posts: 10104
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Internet connection only work when i use VPN

Post by phd21 »

Hi "thealchemist80",

You are welcome.

Let me clarify myself. Sorry for the confusion. I did not realize that "TorGuard" is your VPN Service Provider and not just a "Tor" system application where your connection to the Internet is random. I looked it up, and it seems like a good VPN service. I do not know how much you pay for it monthly or yearly, but it looks too me like you could save some money by switching to the excellent and lower cost VPN provider "Private Internet Access (PIA)", if you wanted to do that. And, I do not see anything wrong with using the "TorGuard" VPN service.

It is possible that your "TorGuard" service requires using the Google Public DNS IP server addresses, not sure, some do. You can verify that with them or in their setup install instructions. You can always try using a neutral more secure DNS Server provider's IP addresses, from "opennicproject.org", "OpenDNS", or "dns.watch". There might be something in their TorGuard VPN software that you used to setup their service that is not releasing the VPN DNS servers to your default DNS server IP addresses when disconnecting from their VPN server connection, or it could be something that needs changing, or tweaking, in Linux Mint Networking; I am not sure. You can always try manually creating a VPN connection (import VPN) to one of their servers using the Network Manager instead of using their application to see if the problem goes away. I would definitely contact "TorGuard" and tell them what's is happening and see what they have to say.

I think it is very smart for you (& everyone else) to use a reliable VPN service. I also think it is smart to change your local ISP Connection to the Internet to use different DNS server IP addresses. You can easily do this by editing your Local ISP connection through your Network Manager Icon in your system tray panel, rather than from the command prompt, then clicking the IPv4 tab, changing "Method" to "Automatic (Addresses Only)", and putting in 2 or more DNS Server IP addresses, like "162.211.64.20,50.116.40.226" (no quotes, & these are from OpenNic), clicking apply or ok, then logging out and back in, or restarting. You can verify your VPN and or DNS Server IP addresses and changes using the website "www.ipleak.net" (see bottom of this page regarding webRTC leaks).


Hope this helps ...
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
thealchemist80
Level 1
Level 1
Posts: 9
Joined: Mon Aug 29, 2016 4:23 am

Re: Internet connection only work when i use VPN

Post by thealchemist80 »

wow, thankyou so much. I identified WebRTC leaks!!!

I use mozilla. I read that by going into about:config and changing media.peerconnection.enabled to false, it could stop these leaks. Which it did :)

Do you think that is enough, or do you think the WebRTC leak addon for firefox is also necessary?


I don't entirely understand what you mean in your last paragraph about ipv4 and altering these DNS server addresses. Do you mean while one is connected to a vpn to do this, or when you are not using a VPN?

My network manager options only have: automatic, manual, link local only and shared to other computers. And an area to type in the DNS server address(s). Would the example IP addresses you gave work for me, or do they have to be specific. And what would be the purpose of adding them, and how many can you add? Not entirely up to speed with this part of it all as you can tell. And once i added them how would i know if it was effective and using them?

Thankyou
phd21
Level 20
Level 20
Posts: 10104
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Internet connection only work when i use VPN

Post by phd21 »

Hi "thealchemist80",

You are welcome.

Regarding "webRTC leaks", you do not need to add an add-on to Mozilla Firefox, if you edited the configuration like you did. Going to the website "ipleak.net" and or refreshing it's webpage will let you know if you were successful.
thealchemist80 wrote: I don't entirely understand what you mean in your last paragraph about ipv4 and altering these DNS server addresses. Do you mean while one is connected to a vpn to do this, or when you are not using a VPN?
Changing your Local ISP connection's DNS server IP addresses should be done regardless whether you have or use a VPN service. Once you have connected to one of the VPN provider's servers somewhere, then during the time you are connected to that VPN server, you should be using their DNS server IP addresses automatically (also verifiable through "ipleak.net") and just as important, your system's main IP address should be different (at the top of their web page). Once you have disconnected from the VPN server, your system should automatically go back to using the DNS server IP addresses that you specified or to those default DNS servers through your local ISP connection.

Here are two previous posts on using and changing DNS Server IP addresses which I recommend that you read.

Configuring Linux Mint too use a specific DNS other than my ISP's default.
viewtopic.php?f=150&t=218343&hilit=opennic

This post has a lot of good comments and information - Cannot get any torrent client to work
viewtopic.php?f=90&t=216501&hilit=opennic

My ancient underpowered computer cannot run any version of the wonderful Linux Mint Cinnamon desktop edition correctly :( , but I can install it and bring it up on a USB flash drive stick, albeit it's slow and with video errors, to see how the new version 18 and VPN and DNS networking stuff works. The instructions in the links above should be accurate enough to change the DNS server IP addresses even for the new Linux Mint version 18. I am not sure about "Importing VPN configuration file (.ovpn)", but the manual VPN server connection setup should be the same or similar to previous versions of Linux Mint. Apparently, there have been some changes to how those work in this new version 18, from what I have been reading in this forum lately. I will have to get back to you on what I find out regarding these issues, because everything I do on my current ancient computer takes sooo very long to do, so it may be a little while before I can let you know what I find out.

The Link below has great instructions for setting up a VPN server location for Linux Mint versions 17.x or older, but the concept is the same on any system. With a "Paid for" VPN provider's available world wide VPN servers, you can skip the part of creating the "certificate" and "key" files because those are generally provided by your VPN provider and are usually located in the same folder as all the "openVPN" server files "somewhere.ovpn". Also, if your VPN provider has only one certificate file, and no ".key" file, then you can choose a "Connection Type" of just "Password". I would recommend that you use the UDP openVPN configuration files.

How to Establish An OpenVPN Connection in Ubuntu 14.04
http://ubuntuhandbook.org/index.php/201 ... untu-1404/
thealchemist80 wrote: My network manager options only have: automatic, manual, link local only and shared to other computers. And an area to type in the DNS server address(s). Would the example IP addresses you gave work for me, or do they have to be specific. And what would be the purpose of adding them, and how many can you add? Not entirely up to speed with this part of it all as you can tell. And once i added them how would i know if it was effective and using them? Thankyou
There are two issues being discussed here, changing your local ISP connection's DNS server IP addresses, and setting up or importing a VPN server location connection(s). The specific DNS IP addresses from opennic that I mentioned previously are current active working DNS server IP addresses; so yes, they should work for you. But, if you go to their website, "www.opennicproject.org", it will tell you what the best local DNS server IP addresses are for you, always pick the 2 with the best connection times. As I already stated, I'll have to get back to you on manually setting up a Linux Mint 18 Cinnamon VPN server connection. If you look around in you Network Manager, you might be able to do this before I get back to you.

As for verifying changes to DNS servers or your connections to VPN servers, just go to the "www.ipleak.net" website or another website like it, and you should be able to see the differences. Obviously to make a comparison for verification, you need to know your default settings before and then after making changes. If you go to the "ipleak" website before you make any changes, and remember or print your regular standard settings to a printer or PDF file, then make your changes to DNS servers, check the refreshed "ipleak" webpage to make sure the DNS servers are different, then connect to a VPN server somewhere, check the refreshed "ipleak" webpage to make sure your main system IP address is different and the DNS server IP addresses are also different. Then, disconnect from the VPN server location, check the refreshed "ipleak" webpage, and make sure the DNS server IP addresses go back to your custom DNS server IP addresses, or your local ISP's default DNS server IP addresses, and that your system's main IP address is what it should be.

Hope this helps ...
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
jackharvest

Re: Internet connection only work when i use VPN

Post by jackharvest »

I have the exact same issue as the initial post on here. Just upgraded to Mint 18 MATE (Cinnemon has the same issue), did my ruitine installations, and then installed TorGuard from TorGuard.net. It's just as the @OP mentions: Once the VPN is on, it functions as it should -- but once the VPN is turned back to the off position, my updates, my browser, my teamviewer connection, everything that uses a network function is completely hosed.

It's VERY frustrating when you're working on multiple headless servers; You have to get into the comm closet, hook up a monitor, and re-enable the VPN so you can actually do anything.

I guess I'll downgrade back to 17.3 for now. TorGuard hasn't had issues until I upgraded to 18.

Current Workaround in case someone finds this via Google:
https://torguard.net/forums/index.php?/ ... nectivity/
thealchemist80
Level 1
Level 1
Posts: 9
Joined: Mon Aug 29, 2016 4:23 am

Re: Internet connection only work when i use VPN

Post by thealchemist80 »

Thankyou phd21, you really know your stuff and have cleared up a few things for me.

I will read through those threads tomorrow regarding changing my local ISPs DNS server IP adresses and see how i go with it.

Just one thing, when i do an ipleak.net with my VPN turned off, i have 21 DNS addresses detected, from USA Taiwan and all over the world and obviously displaying my real IP address at the top of the page.

But when i connect to my VPN, the DNS address detected is only 1 IP address, are it is the same as my IP address at the top of the page. Which i guess is a good thing as that is the only thing ipleak.net can detect, just one IP address for both my IP and DNS?
phd21
Level 20
Level 20
Posts: 10104
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Internet connection only work when i use VPN

Post by phd21 »

Hi "thealchemist80",

You are welcome.

Sorry, I did not respond sooner, but it took awhile to install Linux Mint Cinnamon 18 on my USB Flash Drive Stick using this very old under-powered computer and to install some stuff I needed for this, and to familiarize myself with version 18. I really like the new updates and changes, but there are some significant differences. So, I have created new step by step instructions for changing your DNS Server IP address in LM 18, see below.
thealchemist80 wrote: Just one thing, when i do an ipleak.net with my VPN turned off, i have 21 DNS addresses detected, from USA Taiwan and all over the world and obviously displaying my real IP address at the top of the page.

But when i connect to my VPN, the DNS address detected is only 1 IP address, are it is the same as my IP address at the top of the page. Which i guess is a good thing as that is the only thing ipleak.net can detect, just one IP address for both my IP and DNS?
It is not uncommon to have many DNS Servers listed, especially with Internet Service Providers (Your Local ISP). When you connect to the VPN providers servers, your system will inherit (use) the VPN's DNS Servers (at least it is supposed too). There may be only a couple DNS Servers listed, or it could be more. It is usually more than one, and I have not seen before where the DNS IP address is the same as primary VPN IP address is at the top of the "ipleak" web page when connected to a VPN server location, so I cannot say if that is right or wrong? It your VPN service is working, I would not worry about it.

Linux Mint 18 Cinnamon Edition
To use custom or alternate DNS Server IP addresses

1. Click the Network Manager (NM) icon in system tray panel
2. Click Network Settings
Workspace 1_002sm.jpg
You need to Edit your Local ISP connection's settings by clicking the Preferences button
Workspace 1_003sm.jpg
If you are connected to the Internet using WiFi, then your Local ISP connection is on the right side, probably at the top with a check mark.

If you are connected to the Internet using a Wired (Ethernet) connection, click Wired on the left, then your Local ISP connection is on the right side, probably at the top with a check mark.

3. To the right of your Local ISP connection, Click the Preferences Tools wrench icon.

Now, the edit network connection "Preferences" screen will appear for your Local ISP connection to the Internet
Workspace 1_004sm.jpg
4. Click IPv4 on the left
5. On the right side to the right of DNS, Click the Automatic Button to "Off".
6. Under DNS you will see a "Server" text entry box, enter (or paste) in your first alternate (custom) DNS Server IP address.
7. Since you are supposed to use at least 2 alternate DNS servers, click the + add button just below on the right, and another DNS Server entry box appears, enter in another alternate DNS Server IP address. You can add more if you like.
Then, Click Apply, click "x" in upper right to exit this edit connection screen.

8. Now you are back on the Network Settings Screen (screen shot 2) showing available connections, Click the button to the right of the Preferences button on your local ISP connection that should look like a square to "Stop" and "disconnect" from the Internet (temporarily), wait about 5-10 seconds, and click it again (which now looks like a right arrow "Play" button) to re-connect to your Internet service provider (isp).
9.Then click the "X" in the upper right to exit the Network Settings screen.

That's it. Now, verify that your custom alternate DNS Server IP Address changes have worked.

10. Bring up your Browser, and goto "www.ipleak.net", click refresh, and now your DNS Server IP addresses should be the new ones you entered, sometimes other similar DNS entries will also show up, but that is ok.

Hope this helps ...
Phd21: Mint 20 Cinnamon & KDE Neon 64-bit Awesome OS's, Dell Inspiron I5 7000 (7573, quad core i5-8250U ) 2 in 1 touch screen
thealchemist80
Level 1
Level 1
Posts: 9
Joined: Mon Aug 29, 2016 4:23 am

Re: Internet connection only work when i use VPN

Post by thealchemist80 »

Hi sorry for the late reply, just wanted to say thankyou for taking the time to walk me through it, much appreciated.

i have been away working and hadn't had time to try this out, but i am going to have a crack at it this weekend.

Thanks again :)
Locked

Return to “Networking”