plagued with ERROR: Linux route add command failed

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
neuronetv
OpenVPN User
Posts: 21
Joined: Fri Jun 07, 2013 7:08 pm

plagued with ERROR: Linux route add command failed

Post by neuronetv » Tue Nov 04, 2014 9:18 pm

I've been hammering at this for hours and trawling google but I can't clear this error, I've seen plenty of forum posts about it but none show a clear solution.
I'm running a centos6 machine with openvpn-2.3.2-2.el6.x86_64, the machine is on 172.16.1.x 255.255.0.0, this is my server.conf:

Code: Select all

port 1194
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key
tls-auth ta.key 0
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
cipher AES-256-CBC
comp-lzo
persist-key
persist-tun
user nobody
group nobody
status openvpn-status.log
verb 3
#push "redirect-gateway def1"
push "route 172.16.0.0 255.255.0.0"
push "route 172.16.1.0 255.255.0.0"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 5 30
log /var/log/openvpn.log
but every time I restart openvpn I get:

Code: Select all

ERROR: Linux route add command failed: external program exited with error status: 2
and thus I can't get the client to play ball. The client connects fine but cannot see any ip address on the server LAN and I don't think I'll sort this until I clear this initial error (which has me baffled).

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: plagued with ERROR: Linux route add command failed

Post by Traffic » Wed Nov 05, 2014 3:29 am

Please see the Forum rules (top of page)

neuronetv
OpenVPN User
Posts: 21
Joined: Fri Jun 07, 2013 7:08 pm

Re: plagued with ERROR: Linux route add command failed

Post by neuronetv » Wed Nov 05, 2014 8:41 am

in what way does my op not meet the forum rules? I've given the server.conf, I've given the log error message, I've tried to be clear and succint in the problem description. Thankyou for brickwalling this topic right from the start.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: plagued with ERROR: Linux route add command failed

Post by Traffic » Wed Nov 05, 2014 10:35 pm

neuronetv wrote:in what way does my op not meet the forum rules?
How about the client details ...
neuronetv wrote:'ve tried to be clear and succint in the problem description
Is this an error on the server or the client ? It is not clear.
neuronetv wrote:Thankyou for brickwalling this topic right from the start
This is not a brick wall .. this is how you get help from Volunteers ...

neuronetv
OpenVPN User
Posts: 21
Joined: Fri Jun 07, 2013 7:08 pm

Re: plagued with ERROR: Linux route add command failed

Post by neuronetv » Thu Nov 06, 2014 9:10 am

ok thankyou and I note your points.
This problem only concerns the startup of openvpn on the centos server, it has nothing to do with a client connecting. This problem is entirely on the server, sorry if I didn't make that clear in my op. In starting openvpn I keep getting:

Code: Select all

ERROR: Linux route add command failed: external program exited with error status: 2
and I don't understand what's wrong with my server config to cause this.
ps: I've also tried uncommenting '#push "redirect-gateway def1"' but it made no difference.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: plagued with ERROR: Linux route add command failed

Post by Traffic » Thu Nov 06, 2014 11:35 am

neuronetv wrote:I don't understand what's wrong with my server config to cause this.
I don't think there is anything wrong with your server config.
neuronetv wrote:I've also tried uncommenting '#push "redirect-gateway def1"' but it made no difference.
Why would it ?

The error:
neuronetv wrote:ERROR: Linux route add command failed: external program exited with error status: 2
is exactly what it says: Linux route add command failed.

In your server config the only point the "route add" command is used is by the --server directive. See --server in The Manual v23x

As to why it fails, the only reason I can think of is that you are not running OpenVPN with sufficient rights to alter the routing table ...

But as we still don't have the full log this is just a guess..

Post Reply