Failure to add VPN routes automatically
Posted: Sun Jun 23, 2019 12:52 pm
I have an OpenVPN test setup installed on a VPS. I have to make a particular client available to the server so I have assigned a static IP using a client config.
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
When I test this setup with an Ubuntu OVPN client everything works fine. The client is getting the right static IP and the routes are getting updated properly. I can ping to 10.8.0.1 which is the VPN gateway.
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.
The routes are not getting setup therefore I cannot ping the VPN gateway.
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
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