How to have VPN connection establish at startup? [SOLVED]

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
raffael84
Level 1
Level 1
Posts: 34
Joined: Sun Jan 10, 2016 5:45 pm

How to have VPN connection establish at startup? [SOLVED]

Postby raffael84 » Sat Sep 02, 2017 7:40 am

Hello!

I use ProtonVPN with OpenVPN 2.3.10 on Linux Mint 18.2.

I would like the VPN connection to be established automatically right after successful connection to the internet.

What I tried so far is setting

Code: Select all

AUTOSTART="all"
in /etc/default/openvpn. This didn't work.

Any ideas?

Kind Regards

Raffael
Last edited by raffael84 on Sat Sep 16, 2017 7:01 am, edited 1 time in total.

User avatar
catweazel
Level 10
Level 10
Posts: 3116
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How to have VPN connection establish at startup?

Postby catweazel » Sat Sep 02, 2017 8:06 am

Did you...?
<scratch that>

Sorry.
Mint Donor #6036
If your problem is fixed, please mark your thread as [SOLVED] by editing the title of the first message in the thread.

hrmcrm
Level 4
Level 4
Posts: 201
Joined: Sun Jul 03, 2016 5:59 pm
Location: San Francisco

Re: How to have VPN connection establish at startup?

Postby hrmcrm » Sat Sep 02, 2017 11:19 am

What desktop are you using? Auto-connect to VPN is easy in KDE. If you are using KDE, I'll provide details.
Howard
ThinkPads 310ED, 600E, T23, X41, X60, T61, X201, E550

User avatar
phd21
Level 13
Level 13
Posts: 4697
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: How to have VPN connection establish at startup?

Postby phd21 » Sat Sep 02, 2017 12:41 pm

Hi "raffael84",

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.

Assuming that you have used the Network Manager to import your VPN servers, then you can change (edit) your local ISP connection to the Internet to select which VPN to start, see "General Tab".

I would also recommend changing local ISP DNS server IP addresses to a DNS provider's DNS server ip addresses, and update the openVPN software.



Hope this helps ...


NetworkManager_AutoConnect_VPN1sm.jpg
Network Manager (KDE 18.1) - Editing Local ISP connection to auto-connect to a specific VPN server.
Phd21: Mint KDE 17.3 & 18.1, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,3gb Ram,160gb hdd, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
F M Waterman
Level 1
Level 1
Posts: 26
Joined: Mon Jul 24, 2017 8:22 am

Re: How to have VPN connection establish at startup?

Postby F M Waterman » Tue Sep 12, 2017 11:10 pm

Howdy raffael84,

I use ProtonMail and think its great, but I've had no experience with their VPN service.

IF you are using Cinnamon desktop (which I am) AND you have configuration (.ovpn) files acquired from Proton, then the rest should be as easy as falling off a frog!

I'm going to start from the beginning and go through the entire process step by step, because that's how I like it and that's how I do.

Assuming your answer to the first two questions is 'affirmative', then the next question/step is to install the openvpn network adapters. We'll do that 'old school', from the command line.

Open the Terminal on your computer.

First command:

sudo apt update <enter>

You will be asked for the root password for your computer. If it is put in correctly, the repositories setup on your computer will be queried in turn for the latest information on packages available from them. This step, and all subsequent commands are complete when you observe the command prompt reappear. If you don't see it, DO NOT PANIC, but just wait. It will return by and by,

Second command:

sudo apt install openvpn <enter>

This will cause the OpenVPN adapter to be installed to your computer.

Third command:

sudo apt install network-manager-openvpn <enter>

This will cause the OpenVPN plugin core to be installed.

Fourth command:

sudo apt install network-manager-openvpn-gnome <enter>

This will cause the OpenVPN plugin for the GNOME GUI to be installed.

Once the fourth command has been completed, you will be ready to close the Terminal window and proceed with configuring Proton's VPN service for your computer AND enabling it to start on connection to the Internet.

In the system tray, click on the network connection icon and select Network Settings from its menu.

In the Network Settings window, click on the button with the plus symbol. This will begin the process of adding a new connection to the network manager.

From the list, select VPN. In the next selection window that appears, select 'Import from File'. This will cause a 'select file to import window to open'.

Navigate to where you saved the configuration file obtained from Proton, select the file with the .ovpn extension and click the button labeled 'Open'. You should then be returned to a Network Connections window where you will input your credentials for the VPN service. This same window should have a checkbox you can click to connect using your VPN at startup.

And that's all there is to it! Let us know how everything works out.
Just because you're paranoid doesn't mean Big Brother isn't watching everything you do and without any judicial authority OR oversight![/i]

rbsudo
Level 1
Level 1
Posts: 34
Joined: Sat Jul 15, 2017 10:59 am

Re: How to have VPN connection establish at startup?

Postby rbsudo » Wed Sep 13, 2017 2:35 pm

I'm running Linux mint 18.2 Cinnamon..... with VPN Gate installed.

To establish that VPN connects at startup, I have to:

1. Click on my network icon.

2. Click on Network Connections.

3. Highlight my connection under Ethernet (in my case it's Wired connection 1..... but could be wireless, etc)
That allows editing. Click on Edit.

4. Then click on General tab where I can select:
'Automatically connect to VPN when using this connection'
Click on the server I want to connect to at startup (from a dropdown list).
Click on Save.
Linux Mint 18.2 Sonya.. Cinnamon.. 32-bit
"I learn by going where I have to go," Roethke

User avatar
F M Waterman
Level 1
Level 1
Posts: 26
Joined: Mon Jul 24, 2017 8:22 am

Re: How to have VPN connection establish at startup?

Postby F M Waterman » Fri Sep 15, 2017 8:21 pm

Having just re-installed Linux Mint 18.2, I realize that the information I provided was incorrect.

For that, I am profoundly sorry. :oops:

In the first place, the OpenVPN plugins required by the Network Manager are installed by default.

In the second place, the procedure outlined by rbsudo is spot-on correct and should work for whatever the usual source of connectivity might be, wired or wireless.

I have re-learned two valuable lessons through this:

1) ALWAYS confirm your facts, NEVER ASS-U-ME

2) Heed the words of Abraham Lincoln when he said: "It is better to remain silent and be thought a fool than to speak out and remove all doubt." 8)
Just because you're paranoid doesn't mean Big Brother isn't watching everything you do and without any judicial authority OR oversight![/i]

raffael84
Level 1
Level 1
Posts: 34
Joined: Sun Jan 10, 2016 5:45 pm

Re: How to have VPN connection establish at startup?

Postby raffael84 » Sat Sep 16, 2017 5:52 am

hrmcrm wrote:What desktop are you using? Auto-connect to VPN is easy in KDE. If you are using KDE, I'll provide details.


I'm using Cinnamon 3.4.6.

phd21 wrote: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.


Code: Select all

$ inxi -Fxzd
System:    Host: raffael-GT60 Kernel: 4.10.0-33-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.4.6 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.2 Sonya
Machine:   Mobo: N/A model: MS-16F3 v: REV:1.0
           Bios: American Megatrends v: E16F3IG6.70X date: 01/21/2013
CPU:       Quad core Intel Core i7-3632QM (-HT-MCP-) cache: 6144 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 17559
           clock speeds: max: 3200 MHz 1: 1212 MHz 2: 1199 MHz 3: 1200 MHz
           4: 1202 MHz 5: 1405 MHz 6: 1203 MHz 7: 1213 MHz 8: 1315 MHz
Graphics:  Card-1: Intel 3rd Gen Core processor Graphics Controller
           bus-ID: 00:02.0
           Card-2: NVIDIA GK107GLM [Quadro K2000M] bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 driver: nvidia
           Resolution: 1920x1080@60.00hz
           GLX Renderer: Quadro K2000M/PCIe/SSE2
           GLX Version: 4.5.0 NVIDIA 375.66 Direct Rendering: Yes
Audio:     Card-1 Intel 7 Series/C210 Series Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Card-2 NVIDIA GK107 HDMI Audio Controller
           driver: snd_hda_intel bus-ID: 01:00.1
           Sound: Advanced Linux Sound Architecture v: k4.10.0-33-generic
Network:   Card-1: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller
           driver: alx port: d000 bus-ID: 02:00.0
           IF: enp2s0 state: down mac: <filter>
           Card-2: Intel Centrino Advanced-N 6235
           driver: iwlwifi bus-ID: 03:00.0
           IF: wlp3s0 state: up mac: <filter>
Drives:    HDD Total Size: 564.1GB (9.1% used)
           ID-1: /dev/sda model: SanDisk_SD6SF1M0 size: 64.0GB
           ID-2: /dev/sdb model: HGST_HTS725050A7 size: 500.1GB
           Optical: /dev/sr0 model: TSST CDDVDW SN-208DB
           rev: SB01 dev-links: cdrom,cdrw,dvd,dvdrw
           Features: speed: 62x multisession: yes
           audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition: ID-1: / size: 27G used: 18G (70%) fs: ext4 dev: /dev/dm-1
           ID-2: /boot size: 473M used: 121M (27%) fs: ext2 dev: /dev/sda2
           ID-3: swap-1 size: 34.25GB used: 0.00GB (0%) fs: swap dev: /dev/dm-3
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 53.0C mobo: 27.8C gpu: 0.0:57C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 293 Uptime: 17 min Memory: 1749.8/32064.1MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35


phd21 wrote:Assuming that you have used the Network Manager to import your VPN servers, then you can change (edit) your local ISP connection to the Internet to select which VPN to start, see "General Tab".


My ISP connection is configured on my ISP-provided router. But maybe I misunderstand what you are writing b/c your screenshot definitely provided a new possible solution. I activated that VPN for the WLAN connection.

rbsudo wrote:Automatically connect to VPN when using this connection'


yes - thats what phd21 also suggested. I adjusted that setting. Thanks.

F M Waterman wrote:Howdy raffael84,


no worries!

User avatar
phd21
Level 13
Level 13
Posts: 4697
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: How to have VPN connection establish at startup?

Postby phd21 » Sat Sep 16, 2017 9:53 am

Hi "raffael84",

You are welcome from all of use that responded.

You can now connect automatically to your VPN server now, right?

I do not see anything wrong with the results of your "inxi -Fxzd" command which is great, except the your CPU and its processings cores are not running in performance mode.
CPU: Quad core Intel Core i7-3632QM (-HT-MCP-) cache: 6144 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 17559
clock speeds: max: 3200 MHz 1: 1212 MHz 2: 1199 MHz 3: 1200 MHz
4: 1202 MHz 5: 1405 MHz 6: 1203 MHz 7: 1213 MHz 8: 1315 MHz


Read previous post on this - Force "Performance" CPU Mode?
https://forums.linuxmint.com/viewtopic.php?f=56&t=249555&hilit=performance+mode

Try these instructions for creating / editing the cpufreq file from that link or these links below, and restarting.
- How to set “Performance” instead of “Powersave” as default?
https://askubuntu.com/questions/929884/how-to-set-performance-instead-of-powersave-as-default

- How I can disable CPU frequency scaling and set the system to performance?
https://askubuntu.com/questions/523640/how-i-can-disable-cpu-frequency-scaling-and-set-the-system-to-performance

- How to Permanently Set CPU Governor to Performance in Linux
http://www.preprogrammer.com/how-to-permanently-set-cpu-governor-to-performance-in-linux/

Install cpufrequtils, probably already installed in Linux Mint 18.x:

Code: Select all

sudo apt-get install cpufrequtils


Then edit the following file (if it doesn't exist, this will create it):
I like the "Gedit" graphical text editor, so if that is not installed install it first.

Code: Select all

sudo apt install gedit

Code: Select all

sudo gedit /etc/default/cpufrequtils


And add the following line to it exactly as it is, copy and paste it from here if you want:

Code: Select all

GOVERNOR="performance"


Save the text file and exit the text editor. You may have to logout or restart your system.

Now you might also need to disable "ondemand daemon", otherwise after you reboot the settings might be overwritten.

Code: Select all

sudo update-rc.d ondemand disable


And you are done!
You can check your settings with:

Code: Select all

inxi -Fxzd

or

Code: Select all

cpufreq-info


You can turn off your computer and restart it to see if the changes stick.



Hope this helps ...
Phd21: Mint KDE 17.3 & 18.1, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,3gb Ram,160gb hdd, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde


Return to “Other networking topics”

Who is online

Users browsing this forum: No registered users and 4 guests