• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remot VPN connection from netPI to company network
#1
Hello,

I am looking for a guideline on how to connect my netPI from a remote location (it will be connected to a standard household router with internet access) to my companies network via VPN. Meaning, I want the netPI to act as a VPN client and automatically connect to my specific company network on startup to then access the netPI from my company network like if it was directly connected. 
I assume, I need to install a package for that, but could not find it on my search so far. 
Thanks a lot in advance for your help.

Best regards,
Johannes
  Reply
#2
Well Johannes,

Which type of VPN server you are talking about? 

Is your companies server an OpenVPN server you want to connect to? Or is it a PPTP, or L2TP/IPSec or SSTP or IKEv2? Can't find this info in your post.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
Hi Armin,

thanks for your prompt response.
I had to consult my IT infrastructure experts, and they said to me that it is OpenVPN. Would that work?

Best regards,
Johannes
  Reply
#4
Well OpenVPN makes me happy since I can't tell you anything of the others.

It the most popular VPN technology used. I running an OpenVPN server in my home network too and I am able to login from my office netPI to this home network over VPN. So it is pretty much the same setup you have to realize.

This is how I did it:

1. I deployed the raspbian container https://hub.docker.com/r/hilschernetpi/netpi-raspbian/ first of all to my netPI. Raspbian container gives a netPI a "flair" of being a standard commercial Raspberry PI.
2. As next I connected to the Raspbian container over an SSH client such as putty to be able to call Linux command in the console
3. Since OpenVPN client is available as installer included in the Raspbian container you just can simply call
  
Code:
sudo apt update
sudo apt install openvpn

4. As next your IT team has to provide you a socalled *.ovpn configuration file which tells a client how to connect to the OpenVPN server and how the client shall behave in general
5. Take this *.ovpn file and copy it over to the Raspbian Container (with WinSCP for example) 
6. Finally you can start now the OpenVpn Client calling
Code:
openvpn --config <your config file>.ovpn

7. If netPI has internet connection it will connect to the OpenVPN server now with charm.
8. Since netPI features Docker it depends now on the Raspbian container settings how "far" the connection between the client and server reaches. If the Raspbian container is running in bridge mode ... the client/server connection will not leave the containers internal network. This is different if the Raspbian container was started in "host" network mode which is more open.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#5
Thanks a lot for the detailed description. 
Everything worked quite well.
When starting the 'openvpn --config <your config file>.ovpn' however after starting up normally, I run into the following error: 
   
I would be grateful for advice on how to fix this.

Best regards
Johannes
  Reply
#6
Oh yes this is something coming from the restiction of the netPI Docker engine.

Any Linux device that is needed in a container like the /dev/tun ... on netPI needs to be mapped manually in the container start parameter.

It is the same thing as you need to configure in one of our other containers we are providing which is this one here https://hub.docker.com/r/hilschernetpi/n...hernet-lan. This is an example for you to see which device to map ... /dev/net/tun. So you need to redeploy your Raspbian container again with this device mapped and also I think you should make sure you activated the privileged mode too.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#7
Oh, cool.
I mapped Host path /dev/net/tun -> Container path /dev/net/tun under Runtime & Resources via add device and now it is working.
Thanks a lot again, also for Your extraordinary fast response time.
Best regards,
Johannes
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Network issues after upgrading to Stretch + kernel to 5.4 carmel85 2 3,015 July-28th-2020, 03:04 PM
Last Post: Armin@netPI
  netpi-desktop-hdmi with setting network=bridge tad 13 8,087 June-19th-2020, 12:50 PM
Last Post: tad
  VPN tunnel to netPI and local network in 10 minutes Armin@netPI 0 2,210 June-5th-2020, 05:40 PM
Last Post: Armin@netPI
  Web browser reports "insecure connection" when accessing netPI for the first time Armin@netPI 2 2,750 January-31st-2020, 07:07 AM
Last Post: Armin@netPI
  [SOLVED] Slow network connection Andi 5 3,528 May-22nd-2019, 05:16 PM
Last Post: Armin@netPI
  Modbus TCP Connection via RTE Ethernet Ports Flo_Lo 18 11,161 April-15th-2019, 09:50 PM
Last Post: Armin@netPI
  3 Network Ports possible on NIOT-E-NPI3-51-EN-RE? yulian 7 8,324 April-3rd-2018, 02:57 PM
Last Post: Armin@netPI
  NTP setup (Network time protocol) zulliger@software-natives.ch 1 2,523 February-7th-2018, 09:05 PM
Last Post: Armin@netPI
  Container IP address - Network Options kimsmyth 2 3,226 January-30th-2018, 11:04 AM
Last Post: kimsmyth

Forum Jump:


Users browsing this thread: 1 Guest(s)