0

I would like to do a site-to-site with 2 raspberry pi.

1 rpi as openvpn server on Lan 1 1 rpi as openvpn client on Lan 2

Lan 1 - 192.168.1.0/24 Gateway - 192.168.1.1 Rpi ovpn server - 192.168.1.3 printer - 192.168.1.10

Lan 2 - 192.168.90.0/24 Gateway - 192.168.90.1 Rpi client - 192.168.90.20 pc - 192.168.90.15

What I need to do in server.conf and clien.conf in order to all the devices on both Lan's can comunicate?

TIA

1 Answer 1

0

On server.conf you have to add:

push "route 192.168.1.0 255.255.255.0"
client-config-dir /etc/openvpn/ccd
route 192.168.90.0 255.255.255.0 

This last one is only required if you need other vpn clients to see the Lan2

You have to create a file with the name of the rp1 client certificate inside /etc/openvpn/ccd. For example, if the certificate of rp1 client has name/CN rp1 then create the file /etc/openvpn/ccd/rp1 with the following:

iroute 192.168.90.0 255.255.255.0

Client.conf does not require any special tunning.

4
  • Thanks for your kind support. On the router / gateway I don't need to add any static route? And with this information, from the client side Lan, will the devices (like 192.168.90.15) comunicate with 192.168.1.10?
    – plopes
    Oct 4, 2018 at 16:32
  • For this to work both routers should have a static route pointing at the other LAN via the rpi. You could also insert the route directly in the LAN's devices if the routers don't offer this option.
    – iceburn_pt
    Oct 26, 2018 at 6:18
  • Many thanks! I had to put the static routes on bouth routers. Everything is running like a charm! Thanks!
    – plopes
    Oct 26, 2018 at 10:56
  • please accept the answer.
    – iceburn_pt
    Oct 26, 2018 at 11:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .