LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-20-2017, 01:10 PM   #1
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
VPN on dynamic IP, any guides?


I would like to set my Pi up as a VPN server I can connect to from various other devices from the internet.
The Pi is at "home base" attached to a standard home wireless router.
I have looked for tutorials for VPN but they always seem to expect a fixed IP address or some kind of dynamic DNS, which always seem to give me errors with reverse lookups when trying to use them for SSH.
Any ideas for somebody without a fixed IP? Do the dynamic DNS solutions definately work for VPNs?
 
Old 07-20-2017, 05:33 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
My dynamic DNS works fine with VPN. Nothing special to do.
 
1 members found this post helpful.
Old 07-20-2017, 08:11 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
I guess it would depend on the VPN you are using.

There are a lot of ways to secure a connection.
 
Old 07-21-2017, 12:48 AM   #4
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Original Poster
Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Oddly, I managed now to find a tutorial not expecting a fixed IP address, using openvpn and some setup scripts. Perhaps that's the place to start then I can look into dynamic DNS -- as I mentioned I did do some testing with a free dynamic DNS service and couldn't SSH due to some kind of issue with reverse-lookup on the IP not matching the domain I was attaching to (or something) so I worried abotu this kind of thing with a VPN.
 
Old 07-21-2017, 06:58 AM   #5
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by 273 View Post
Oddly, I managed now to find a tutorial not expecting a fixed IP address, using openvpn and some setup scripts. Perhaps that's the place to start then I can look into dynamic DNS -- as I mentioned I did do some testing with a free dynamic DNS service and couldn't SSH due to some kind of issue with reverse-lookup on the IP not matching the domain I was attaching to (or something) so I worried abotu this kind of thing with a VPN.
You definitely don't need reverse-dns for ssh to work, whether it's a static or dynamic ip. Or maybe the UseDNS directive was enabled. Try to disable it first (it's /etc/ssh/sshd_config in CentOS)
 
Old 07-21-2017, 09:38 AM   #6
brettjohnson
LQ Newbie
 
Registered: Jul 2017
Location: USA
Posts: 2

Rep: Reputation: 0
Smile Change your Connection

My DNS works fine.
You should get another connection or use a different VPN. Well, you can use PureVPN or PIA. They both are perfect. But nowadays, I am using PureVPN because their speed is good and works fine without any disconnectivity.
I am just giving you a suggestion so do a deep research first. Or you can read this content on How to Get A VPN. Or simply go to Google and explore the world.

No thanks need.

Brett.
 
Old 07-21-2017, 09:42 AM   #7
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
The problem is that they're both commercial, whereas openvpn is free. And it's a very good solution, and it's not really that hard to configure. Of course, you won't be able to configure it by clicking nexts (although some builtin system do offer wizards for openvpn - clear os, some netgear routers, etc.), but still...
 
1 members found this post helpful.
Old 07-21-2017, 12:27 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Original Poster
Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Thatbks, I'll take a look at my SSH settings and I am now on a different remote device so things may go better.
As to the choice of VPN OpenVPN seems the only open source, free choice? Not that I am averse to paying for open source software but I'd like to get things working first.
To expand: The idea is to run a VPN on the Pi so that no matter which network I choose to connect from I am likely safe from snooping and MITM for my Blackberry device and laptops and, also, so I can use my home network as if I were at home.
 
Old 07-21-2017, 12:39 PM   #9
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
A downside to watch with the dynamic DNS services is that the free ones have to be renewed frequently and the paid ones aren't really cost effective. A few regular DNS registrars offer dynamic services on the side as part of their service. I don't have a list of those however.
 
1 members found this post helpful.
Old 07-21-2017, 12:44 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Original Poster
Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
The short-term plan would be using a free one (I've done it before for web hosting) for "proof of concept" then I may be willing to pay for it. After that, who knows? I've a domain I'm winding down usage of which I could use and I think my hosting company may still do dynamic DNS (recently learned they stopped doing VPSs).
 
Old 08-11-2017, 02:26 PM   #11
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Just to clarify your question - If I may inquire...

Your are wishing to connect to your home network FROM the Internet?

Your Internet connection (standard home wireless router) gets a dynamic IP address from your ISP?

If the above is true I am not sure it is possible to setup what you desire. In order for your device "on the Internet" to connect to your Pi VPN server it first has to find your home IP address. With a dynamically assigned value from your ISP this is problematic.

Perhaps you could tunnel the the Pi to a resource on the Internet and then connect your device on the Internet to that same resource and then back to the Pi. Here is an article https://arstechnica.com/gadgets/2017...rcial-options/ which talks about using a virtual machine hosted on a hosting service to build your own VPN. Not sure if this helps. Perhaps I have misunderstood the question.

Ken
 
Old 08-11-2017, 09:01 PM   #12
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,384
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
I used noip.com's dynamic DNS service for several years back when I self-hosted my website and found their service to be excellent.
 
Old 08-11-2017, 11:32 PM   #13
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762
Dynamic DNS is definitely what you need to maintain a link between a URL and your home IP address.
I have used a number of home modem/routers that have an in-built dynamic DNS capability that will update on an IP address change, but they only allowed the use of DynDNS as the provider. This used to be free, but is now a paid service.
An alternative would be to use the Pi to maintain your dynamic DNS at the provider of your choice. I have used https://freedns.afraid.org/ for several years.
 
Old 08-12-2017, 12:42 AM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Original Poster
Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Thanks for the responses, my IP address tends to be fixed for months at a time so a dynamic DNS provider would be great.
however, I still seem to be struggling to actually set up a VPN at all - having followed a guide in what I thought to be a thorough manner and getting crt files onto my laptop I still couldn't connect to the VPN (Network Manager just keeps trying, unsuccessfully, to connect.
I've managed to set a few things up on my Pi in the past but, for some reason, VPN defeats me every time. (I am opening the relevant port on my home router etc. -- I've already got passwordless SSH on a non-standard port working fine)
 
Old 08-12-2017, 01:01 AM   #15
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,359
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
Quote:
Originally Posted by 273 View Post
I've already got passwordless SSH on a non-standard port working fine)
You can use that as a SOCKS5 proxy while you work out the details on the regular VPN. See the -D option in ssh

Code:
man ssh
Your browser supports SOCKS5 and probably so does your mail client. It would just be a matter of connecting with SSH and pointing the desktop (or individual programs) to the proxy.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto vpn connection behind dynamic ip - CentOS 7 howithink Linux - Newbie 0 03-11-2016 06:44 PM
Dynamic IP VPN between IpSec(OpenBSD) and Linux VPN software Peter_APIIT Linux - Server 2 04-09-2008 05:08 AM
IPsec VPN - Dynamic Server IP, NAT, etc. jantman Linux - Networking 3 01-16-2007 12:11 AM
How To guides to setup an SSH Tunnel and VPN, and Print Servers pfish Linux - Networking 1 10-29-2004 06:13 PM
Can I be a VPN server if my IP is dynamic? Avatar Linux - Networking 3 06-22-2004 11:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration