I have configured a VPN server

dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server-vpn.crt
key /etc/openvpn/easy-rsa/keys/server-vpn.key
dh /etc/openvpn/easy-rsa/keys/dh1024.pem
push "route"
push "route"
push "route"
push "dhcp-option DNS"
push "redirect-gateway def1"
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
cipher AES-128-CBC
user nobody
group nogroup
status /var/log/openvpn-status.log 20
log /var/log/openvpn.log
verb 1

When connect with openvpn client from linux terminal with this command:

openvpn --config /home/user/myfile.ovpn

I have this error:

OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Dec  1 2014
Control Channel Authentication: tls-auth using INLINE static key file
UDPv4 link local: [undef]
UDPv4 link remote: [AF_INET]xx.xx.xx.xx:1194
[server-vpn] Peer Connection Initiated with [AF_INET]xx.xx.xx.xx:1194
TUN/TAP device tun0 opened
do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
/sbin/ip link set dev tun0 up mtu 1500
/sbin/ip addr add dev tun0 local peer
RTNETLINK answers: Invalid argument
ERROR: Linux route add command failed: external program exited with error status: 2
RTNETLINK answers: File exists
ERROR: Linux route add command failed: external program exited with error status: 2
Initialization Sequence Completed

The following routes are wrong. You can't add the first two (and don't need to add manually) as they are the vpn ip range for tunnel you have configured. (The two are also redundant, as is part of network.) The third is your local net and will be added automatically. So, remove them all and see.

push "route"
push "route"
push "route"

See: https://openvpn.net/index.php/open-source/documentation/howto.html

Push route is used to add route to other private subnets.

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (
# back to the OpenVPN server.
;push "route"
;push "route"
  • I have removed the two lines and have tha same error but one times instead of two – hellb0y77 Feb 17 '16 at 9:14
  • @hellb0y77, ohh, you also have push "route", remove this too and see. – Diamant Feb 17 '16 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.