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

This forum is for admins who are looking to build or expand their OpenVPN setup.

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.
Locked
Anna Gz
OpenVpn Newbie
Posts: 2
Joined: Wed May 16, 2018 3:53 pm

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

Post by Anna Gz » Wed May 16, 2018 4:06 pm

Hello community.
I'm having an error connecting from the client machine.

Code: Select all

RTNETLINK answers: File exists
Tue May 15 23:45:19 2018 ERROR: Linux route add command failed: external program exited with error status: 2
server.conf

Code: Select all

port 16122
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
key-direction 0
cipher AES-256-CBC   # AES
auth SHA512
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn-status.log
log /var/log/openvpn.log
verb 3
mssfix 0
client.conf

Code: Select all

client
dev tun
proto udp
sndbuf 0
rcvbuf 0
remote xxx.xx.xx.xx 16122
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
remote-cert-tls server
key-direction 1
cipher AES-256-CBC
auth SHA512
comp-lzo
verb 3
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
Output of the "route" command on the client while using vpn

Code: Select all

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.8.0.1        128.0.0.0       UG    0      0        0 tun0
default         gateway         0.0.0.0         UG    600    0        0 wlp3s0
10.8.0.0        *               255.255.255.0   U     0      0        0 tun0
128.0.0.0       10.8.0.1        128.0.0.0       UG    0      0        0 tun0
link-local      *               255.255.0.0     U     1000   0        0 wlp3s0
185.141.27.87   gateway         255.255.255.255 UGH   0      0        0 wlp3s0
192.168.1.0     *               255.255.255.0   U     600    0        0 wlp3s0
I go online through a router from a laptop. I start vnn through the terminal.
Please tell me how can I fix this error?

TinCanTech
OpenVPN Protagonist
Posts: 11138
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Wed May 16, 2018 4:55 pm

Anna Gz wrote:
Wed May 16, 2018 4:06 pm

user nobody
group nogroup
Remove these from your client config so when it disconnects it can tear those routes down before adding them again on reconnection.

Anna Gz
OpenVpn Newbie
Posts: 2
Joined: Wed May 16, 2018 3:53 pm

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

Post by Anna Gz » Wed May 16, 2018 5:28 pm

You are beautiful!
Thank you very much. Error has gone

rhinionic
OpenVpn Newbie
Posts: 1
Joined: Thu Mar 21, 2019 5:05 am

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

Post by rhinionic » Thu Mar 21, 2019 5:06 am

I had this exact problem, but I do not know where to find the client.conf file such that I may edit it.

TinCanTech
OpenVPN Protagonist
Posts: 11138
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Thu Mar 21, 2019 6:29 am

rhinionic wrote:
Thu Mar 21, 2019 5:06 am
I do not know where to find the client.conf file
You are doomed.

Locked