There are many similar topics about my issue, however I cannot figure out a solution for myself.
There are three hosts. A without a routable address but with an Internet access. Server S with a routable Internet address and host B behind NAT in a private network.
What I've managed to do is a OpenVPN connection between A and B via S. Everything works fine so far according to this manual VPN Setup
What I want to do is to connect A to Bs private network 10.A.B.x I tried this manual but had no luck.
So A has a vpn address 10.9.0.10, B's vpn address is 10.9.0.6 and B's private network is 10.20.20.0/24.
When at the Server I try to make a route to Bs private network like this
sudo route add 10.20.20.0 netmask 255.255.255.0 gw 10.9.0.6 dev tun0
it says "route: netmask 000000ff doesn't make sense with host route" but I don't know how to tell Server to look for a private network in a different way.
Do you know how can I make it right ?