Raspi with OpenVPN Client not accessible from LAN when using different Subnet

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
unknownMe
OpenVpn Newbie
Posts: 7
Joined: Wed Mar 14, 2018 12:11 pm

Raspi with OpenVPN Client not accessible from LAN when using different Subnet

Post by unknownMe » Wed Mar 14, 2018 12:20 pm

Hi,
I hope you can help me,
I have a few raspis in the LAN 192.168.1.0.
Each one of them uses it's separate OpenVPN as a client to connect to a server.
When I'm in the LAN I can connect / ping all of them.

Now the tricky part. My router runs a OpenVPN Server, so subnet when connected is 192.168.2.0
When coming from that subnet I can't ping / connect to any of the Rapsis in the subnet 192.168.1.0 running OpenVPN.

I tried the following in my openvpn client config on the raspi:
route add 192.168.1.0 mask 255.255.255.0 gw IP_OF_RASPI
route add 192.168.2.0 mask 255.255.255.0 gw IP_OF_RASPI

Any idea what is wrong or what I need to do so I can access the raspi form 192.168.2.0?
I have ufw activated on the raspi but its allowing 192.168.0.0/16 so it's not the firewall :(

TIA!

unknownMe
OpenVpn Newbie
Posts: 7
Joined: Wed Mar 14, 2018 12:11 pm

Re: Raspi with OpenVPN Client not accessible from LAN when using different Subnet

Post by unknownMe » Fri Mar 23, 2018 2:02 pm

Does no one has an idea? Or do you need more details?

Please help, tnx!

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Raspi with OpenVPN Client not accessible from LAN when using different Subnet

Post by TinCanTech » Fri Mar 23, 2018 7:05 pm


unknownMe
OpenVpn Newbie
Posts: 7
Joined: Wed Mar 14, 2018 12:11 pm

Re: Raspi with OpenVPN Client not accessible from LAN when using different Subnet

Post by unknownMe » Wed Mar 28, 2018 2:33 pm

Actually I found the solution. If some1 else is struggling, just add the following line into your openvpn client config (related to my question above, replace with your networks, 192.168.1.1 is my router's main IP, as VPN Server it still has 192.168.2.1):

route 192.168.2.0 255.255.255.0 192.168.1.1

Post Reply