D
D
Dima_kras2019-02-25 17:25:21
openvpn
Dima_kras, 2019-02-25 17:25:21

How to access multiple Raspberries using OpenVPN?

Good afternoon, there are 5 raspberries all connected to the Internet, but there is no way to configure port forwarding, there is no white ip either. You need to be able to connect to the Raspberry as if it were on the local network via, ssh, vnc, etc.
The idea is this: buy a server like Amazon AWS, set up OpenVPN on it. Connect all raspberry to VPN and connect the laptop to VPN too and you will be able to access Raspberry.
Nuance, web services are running on the raspberry, they need to have access to the Internet bypassing the VPN. I plan to use the VPN only for configuring or monitoring Raspberry when needed.
How to set it all up?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgen, 2019-02-25
@etaliorum

Routes, for example, if web services then say that packets from 80 and 443 (or whatever you have there) of the port go to the provider's gateway, and not to the tunnel interface.
To help ip routeand ip rule, we mark incoming packets to a specific port with iptables, and give it all away Forip route
inspirationTYC

R
res2001, 2019-02-25
@res2001

In order for the Raspberry web server to continue to accept requests from the Internet, you simply need to configure the OpenVPN server so that it does not make itself the default router for clients. To do this, it is enough not to specify / comment out one directive in the server config (however, in my opinion, it is already commented out by default):
push "redirect-gateway def1 bypass-dhcp"
Provide distribution of fixed IP addresses to clients in your VPN for Raspberry, otherwise you will constantly look for the right raspberry.

D
Dmitry, 2019-02-25
@hempy80


There should be no redirect-gateway autolocal directive in the north config
But there should be
client-to-client
Nothing else is required, OpenVPN will do everything by itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question