LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Restoring VPN Connections in Slackware. (https://www.linuxquestions.org/questions/slackware-14/restoring-vpn-connections-in-slackware-4175647498/)

cwizardone 02-02-2019 11:20 AM

Restoring VPN Connections in Slackware.
 
A search hasn't returned anything useful on this subject.

Every time I do a fresh install I have to re-create each vpn connection, one by one. It doesn't matter that I backed them and restored them, the NetworkManager software (with the openvpn plug-in) doesn't see them.

Anyone know the secret to restoring the connections?
:)

Thanks.

abga 02-02-2019 04:59 PM

I'm not using any automagic network manager, don't trust them, instead keeping it simple and unitary, using /etc/rc.d/rc.inet2 for the advanced networking stuff.
Just after starting the firewall, that's putting the chastity belt on first:
Code:

if [ -x /etc/rc.d/rc.firewall ]; then
  /etc/rc.d/rc.firewall start
fi

- create your own script for advanced stuff - routing&tunneling
Code:

# Start the advanced net stuff
if [ -x /etc/rc.d/rc.advnet ]; then
 /etc/rc.d/rc.advnet
fi

- /etc/rc.d/rc.advnet content - example
Code:

#!/bin/sh
# routing & co
#Start tunneling
/usr/sbin/openvpn /etc/vpns/openvpn0.conf
/usr/sbin/openvpn /etc/vpns/openvpn1.conf
/usr/sbin/openvpn /etc/vpns/openvpn2.conf
/usr/sbin/openvpn /etc/vpns/openvpn3.conf
#....


ferrari 02-02-2019 08:20 PM

The connection profiles are located in the /etc/NetworkManager/system-connections/ directory, so make sure you back that up to preserve the necessary.

cwizardone 02-02-2019 08:51 PM

Quote:

Originally Posted by ferrari (Post 5956994)
The connection profiles are located in the /etc/NetworkManager/system-connections/ directory, so make sure you back that up to preserve the necessary.

Yes, that is the directory that each time has been backed up and later restored.

ferrari 02-04-2019 12:50 AM

Just in case the following thread is useful to you...

https://superuser.com/questions/8638...pt-command-lin

Regnad Kcin 02-06-2019 08:49 AM

openvpn incorporated has a very fine and reliable tool for running and connecting vpn's on linux but unfortunately it requires "systemd". I find the documentation on vpn's in general to be highly opaque and resistant. openvpn inc. doesn't much care.

coralfang 02-06-2019 01:47 PM

If you have *.ovpn files provided by your VPN owner/company... you can mass import them using this command:

Code:

# for i in *.ovpn; do nmcli connection import type openvpn file "$i"; done
You'll still have to re-enter the username/password for each one once you first connect however.

cwizardone 02-08-2019 10:47 AM

Quote:

Originally Posted by coralfang (Post 5958702)
If you have *.ovpn files provided by your VPN owner/company... you can mass import them using this command:

Code:

# for i in *.ovpn; do nmcli connection import type openvpn file "$i"; done
You'll still have to re-enter the username/password for each one once you first connect however.

That is what I've been doing.
First, I backup /etc/NetworkManager (and all its sub-directories) and ditto all the .ovpn files from the VPN.
And, as you have pointed out, once there are all restored, it is still necessary to "re-create" each connection, one by one.

FTIO 02-08-2019 09:20 PM

Just put it on your router instead, that way you can have any multiple number of machines going through it and not have to start the vpn for each separate one (I hope that made sense). Install DD-WRT on your router, then setup what you need from your VPN on it.

Regnad Kcin 02-08-2019 09:31 PM

Quote:

Just put it on your router instead, that way you can have any multiple number of machines going through it and not have to start the vpn for each separate one (I hope that made sense). Install DD-WRT on your router, then setup what you need from your VPN on it.
__________________
Great idea, but sometimes the VPN needs to be off.

If you are using the VPN to spoof your location, you may need your real location sometimes. It's a hassle to go into the router and turn off the VPN there every time you need to give real location or use "inside the firewall" access.

Actually I am finding that plain old OpenVPN via the network manager is working pretty good for me right now.

Regnad Kcin 12-12-2019 09:43 PM

new addition to old thread
 
I just discovered the VPN provider Astrill.

They provide a Linux -friendly widget for starting and managing their VPN service. Unlike the OpenVPN widget supplied by some VPN providers, it does not require systemd to run.
It installs in Slackware-64-current by a simple shell script that contains an install image. It puts the Astrill application in the KDE Plasma5 menu and provides a button in the system tray.

So far, Astrill is fast. It also provides a smart mode which effectively turns the VPN off for local in-country websites. And it installs and runs beautifully under Slackware with no hassle and no need for systemd to prop it up.


All times are GMT -5. The time now is 12:57 PM.