-1

I have a problem and cannot solve it. Would be great to get help from you guys.

I have following setup: LAN where server located: 192.168.0.0/24 OpenVPN server (on a raspery PI): 192.168.0.30 OpenVPN client got IP address: 10.8.0.30

Now I want to ping (actually ssh) from a computer (Windows) with IP 192.168.0.10 in same LAN as VPN server to the OpenVPN client with address 10.8.0.30

I can't get it work. Do you have any suggestions?

Thanks already in advance

  • Is IP forwarding enabled? – markzz Feb 6 at 21:15
  • Yes ip forwarding is enabled – Rufio Feb 7 at 16:48
0

More than likely, IP forwarding is disabled (as is default). You can enable it by following the directions here: http://www.ducea.com/2006/08/01/how-to-enable-ip-forwarding-in-linux/

If IP forwarding is enabled, then check your firewalls on Windows, the OpenVPN server, and the host on the 192.168.0.0/24 network. Make sure the Pi is set to allow forwards from the two networks in its firewall.

EDIT

Since this is a probable configuration issue, you will need to make sure the routes are announced.

In your server.conf, you will need the following:

push "route 192.168.0.0 255.255.255.0"

...

client-config-dir /etc/openvpn/server/ccd
route 192.168.0.0 255.255.255.0

Then create the directory, /etc/openvpn/server/ccd, and then create a file with the name of the common name of the certificate of the server. So if the server's certificate's common name is foo, then create the file /etc/openvpn/server/ccd/foo and put in the following:

iroute 192.168.0.0 255.255.255.0

Then restart both the server and all clients.

  • IP forwarding has already been enabled. All other things you mentioned shouldn't be the problem because exchanging my old router with the current one, everything worked fine (some years ago I changed the routing table from old router but new router does not allow that). Could it be that the following is the problem: with new router the VPN Server's LAN is 192.168.0.0/24 and the local LAN from VPN client is 192.168.0.0/24 as well? With the old router the VPN Server's LAN was 192.168.1.0/24 – Rufio Feb 6 at 21:42
  • I also assumed you configured OpenVPN correctly, did you push the routes with the server's configuration? – markzz Feb 7 at 14:55
  • I added following lines: push "route 10.8.0.1 255.255.255.255" , push "route 10.8.0.0 255.255.255.0", push "route 0.0.0.0 " could the problem be that on both sides the local LAN has the same IP? – Rufio Feb 7 at 16:54
  • You should also have a line that has something along the lines of client-config-dir /etc/openvpn/server/ccd that in the specified directory is a couple of iroute lines. – markzz Feb 7 at 17:23
  • Edited answer to explain configuration... – markzz Feb 7 at 17:41

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.