If you are interested this is the approach I have used. (https://www.itsfullofstars.de/2018/09/openvpn-assign-static-ip-to-client/)
Additionally in order to set the routes properly I am using a push statement in server.conf
Code: Select all
push "route 10.8.0.0 255.255.0.0 10.8.0.1 0"
However if I try to connect with Raspberry OVPN client, the routes are not getting added. Instead I see the following error on the console.
Code: Select all
Sun Jun 23 12:25:56 2019 us=392175 /sbin/ip route add 10.8.0.0/16 metric 0 via 10.8.0.1
RTNETLINK answers: Network is unreachable
Sun Jun 23 12:25:56 2019 us=402420 ERROR: Linux route add command failed: external program exited with error status: 2
Rasbian and Ubuntu both shares a debian kernal therefore I don't think this is related with the platform. How should I troubleshoot this issue?
As an additional hint : you can see the same error on Ubuntu if you try to execute "/sbin/ip route add 10.8.0.0/16 metric 0 via 10.8.0.1" on a new console. That means this operation needs to be done by OVPN process it-self