Sintra
Posts: 2
Joined: Thu Jun 22, 2017 6:44 pm

VPN to multiple sites help

Mon Oct 09, 2017 10:10 am

Hi everyone

The PI's i use are Raspberry Pi 3 revB with RASPBIAN 4.9

I have 5 local sites with two Ethernet devices on each site. There is an overall wireless network witch covers all the sites.
But my problem is that the local devices are not allowed on the overall network, so i think to put a RaspberryPi on each site so the raspberrypi's
connect's to the wireless network via wlan0 and then to a central VPN Server (Also a raspberry pi) like a site to site connection.
So when i from my laptop connect to the same VPN Server via a VPN client i can access all the devices or if i plug my laptop on one of the local lan's.

I got the DHCP server running on the Raspberrypi's but not the part where i manage to setup the VPN part.
Client1: wlan0 IP from overall wireless network DHCP. eth0 IP 192.168.11.0/24
Client2: wlan0 IP from overall wireless network DHCP. eth0 IP 192.168.12.0/24
Client3: wlan0 IP from overall wireless network DHCP. eth0 IP 192.168.13.0/24
Client4: wlan0 IP from overall wireless network DHCP. eth0 IP 192.168.14.0/24
Client5: wlan0 IP from overall wireless network DHCP. eth0 IP 192.168.15.0/24
VPN Server: wlan0 overall wireless network IP 172.12.21.4 . eth0 IP 192.168.20.0/24

I have tried to look around for a example of a solution but i did not find the right one. I need some advice to setup the server part and the best way to do the routing between the different networks so i can access then all.
So i hope someone done this and are willing to help out here ;o)

Jesper

josephchrzempiec
Posts: 168
Joined: Tue Jun 21, 2016 7:56 am

Re: VPN to multiple sites help

Sat May 26, 2018 6:40 am

hello Jesper did you mange to get the multiple locations link together?
I'm also in need of that same help i have one Raspberry pi at each location But i can not figure how to link them together in vpn. I'm not a linux programmer so i have no clue.



Joseph

epoch1970
Posts: 3875
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: VPN to multiple sites help

Sat May 26, 2018 10:06 am

Simple recipe for the case presented by the OP:
Make one tunnel work.
Copy the configuration files on the server, e.g. /etc/openvpn/tunnel.conf -> tunnel-site1.conf, tunnel-site2.conf ...
Change what needs to be unique in each file, e.g. "port 1194", "ifconfig 10.8.0.1" in tunnel-site1.conf, "port 1195", "ifconfig 10.8.1.1" in tunnel-site2.conf ...
In /etc/default/openvpn set "AUTOSTART=all". Then on boot OpenVPN will start all the tunnels you've configured.
Of course on each site and for your roaming machines have as many client configs as required to connect the tunnel(s) you want.

Running many simple tunnels or a single, more complex, server-type tunnel doesn't make much of a difference in practice.
The above does not create a single network: if from a roaming machine you want to reach 2 sites at the same time, you need 2 tunnels.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

sanfx
Posts: 86
Joined: Thu Sep 08, 2016 5:40 pm

Re: VPN to multiple sites help

Thu Sep 26, 2019 10:39 pm

:o The tunnel.conf not found for the latest version i have Installed on my pi.

Code: Select all


openvpn --version
OpenVPN 2.4.0 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Oct 14 2018
library versions: OpenSSL 1.0.2s  28 May 2019, LZO 2.08
Originally developed by James Yonan
Can you tell me default settings of tunnel.conf if it needs to be created manually or is it located at some different path?

Thank you

epoch1970
Posts: 3875
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: VPN to multiple sites help

Thu Sep 26, 2019 11:32 pm

There is no default tunnel configuration.
Create your own client or server file(s) and put them under /etc/openvpn
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

sanfx
Posts: 86
Joined: Thu Sep 08, 2016 5:40 pm

Re: VPN to multiple sites help

Wed Dec 04, 2019 11:50 pm

epoch1970 wrote:
Thu Sep 26, 2019 11:32 pm
There is no default tunnel configuration.
Create your own client or server file(s) and put them under /etc/openvpn
but it dosent auto connect ! Do you mean the ovpn file ?

Return to “Networking and servers”