OpenVPN - ERROR: Linux route add command failed: external program exited with error status: 2

I'm using OpenVPN as my VPN server, and here is the content of auto-generated config file (.ovpn) through pfSense control panel:

dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA1
tls-client
client
resolv-retry infinite
remote x.y.z.t 1194 udp
verify-x509-name "VPN Server CA" name
auth-user-pass
pkcs12 pfSense-udp-1194-user1.p12
tls-auth pfSense-udp-1194-user1-tls.key 1
ns-cert-type server

I'm getting this error when I try to connect the server using the OpenVPN package (OpenVPN 2.3.2 x86_64-pc-linux-gnu) using the configuration above:

ERROR: Linux route add command failed: external program exited with error status: 2

The structure of the directory I execute the command is like that:

.
├── pfSense-udp-1194-user1.ovpn
├── pfSense-udp-1194-user1.p12
└── pfSense-udp-1194-user1-tls.key

What is the reason behind this error?

My operating system is Ubuntu 14.04 LTS (64-bit).


ERROR: Linux route add command failed: external program exited with error status: 2 What is the reason behind this error?

This error doesn't really mean much on its own. The exit code of 2 simply means the kernel rejected your route for some reason. It could be because you already have a route for that network, it could be because the gateway was not appropriate for the network/subnet, or many other things.

In any case bump up the verbosity you should be able to see more details about what specific route was failing.

Depending on the error you may need to fix your configuration, or just ignore the error. Sometimes the vpn server will offer routes, that your computer already has, or do not apply to your current connection.