1

I have 3 VPS servers at OVH. I created a private network, where all servers have public IPv4 and private IPv4 address. I'm trying to give a user access to other VPS servers via private address from OpenVPN host.

For example: When a user connect to OpenVPN server, he has the IP number like 10.8.0.x, now when he is going to page on other VPS like 192.168.0.155, he can't connect to it.

Diagram

Update - OpenVPN server config:

port 1111 proto udp dev tun user nobody group nogroup persist-key persist-tun keepalive 10 120 topology subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "dhcp-option DNS 8.8.8.8" push "dhcp-option DNS 8.8.4.4" push "redirect-gateway def1 bypass-dhcp" dh none ecdh-curve prime256v1 tls-crypt tls-crypt.key crl-verify crl.pem ca ca.crt cert server_AAA.crt key server_AAA.key auth SHA256 cipher AES-128-GCM ncp-ciphers AES-128-GCM tls-server tls-version-min 1.2 tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 client-config-dir /etc/openvpn/ccd status /var/log/openvpn/status.log verb 3 
6
  • 1
    You'll need to share a bunch more details about how you've configured OpenVPN. Things like what routes you are pushing to clients. Commented Dec 23, 2020 at 18:55
  • Description updated Commented Dec 28, 2020 at 20:04
  • So you are pushing the default route to the clients so all traffic should be being forwarded to the OVPN server. How have you configured routing on the server? Commented Dec 28, 2020 at 20:30
  • I tried to add push "route 192.168.0.0 255.255.255.0", but it doesn't work at all. Commented Dec 30, 2020 at 22:32
  • Have you enabled routing on the openvpn server in /etc/sysctl.conf? Commented Dec 31, 2020 at 0:27

1 Answer 1

0

As hashed out in the comments, the OP has not enabled IP forwarding on the OpenVPN server so it won't route any of the incoming packets from the OpenVPN clients to the internal network,

net.ipv4.ip_forward needs to be set to one in /etc/sysclt.conf. That file is only read on a reboot so you should run the following to enable it without a reboot:

$ echo 1 > /proc/sys/net/ipv4/ip_forward 
3
  • I tried it, but I still have errors. Also I added route 192.168.0.0 255.255.255.0 to client ovpn file. On client I have errors like Request timed out.. Commented Dec 31, 2020 at 12:21
  • Do the 192.168 hosts know to route 10.8 hosts via the OpenVPN server (or is it doing NAT) Commented Dec 31, 2020 at 14:43
  • I don't know how to check it. If I ping from client to 192.168.0.x where x is IP of VPS #1 it works, but for other servers it doesn't work. Commented Jan 7, 2021 at 11:47

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.