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, he can't connect to it.


Update - OpenVPN server config:

port 1111
proto udp
dev tun
user nobody
group nogroup
keepalive 10 120
topology subnet
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS"
push "dhcp-option DNS"
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-version-min 1.2
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
verb 3
  • 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. – hardillb Dec 23 '20 at 18:55
  • Description updated – Sebak Dec 28 '20 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? – hardillb Dec 28 '20 at 20:30
  • I tried to add push "route", but it doesn't work at all. – Sebak Dec 30 '20 at 22:32
  • Have you enabled routing on the openvpn server in /etc/sysctl.conf? – hardillb Dec 31 '20 at 0:27

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
  • I tried it, but I still have errors. Also I added route to client ovpn file. On client I have errors like Request timed out.. – Sebak Dec 31 '20 at 12:21
  • Do the 192.168 hosts know to route 10.8 hosts via the OpenVPN server (or is it doing NAT) – hardillb Dec 31 '20 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. – Sebak Jan 7 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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