V
V
Vasily Ivanov2021-07-16 17:55:53
linux
Vasily Ivanov, 2021-07-16 17:55:53

How to use two or more openvpn clients at the same time?

I want to connect to several ip at the same time, for this I use the VPN Gate service and I have, for example, two configs.

First:

dev tun
proto tcp
remote 211.127.50.206 1603
;http-proxy-retry
;http-proxy [proxy server] [proxy port]
cipher AES-128-CBC
auth SHA1
resolv-retry infinite
nobind
persist-key
persist-tun
client
verb 3


Second:
dev tun
proto tcp
remote 219.100.37.24 443
;http-proxy-retry
;http-proxy [proxy server] [proxy port]
cipher AES-128-CBC
auth SHA1
resolv-retry infinite
nobind
persist-key
persist-tun
client
verb 3


When I launch the second client, the following error occurs (the first one running at the same time works):
ERROR: Linux route add command failed: external program exited with error status: 2


If it helps, then ifconfigthey ip routelook like this:
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.211.1.13  netmask 255.255.255.255  destination 10.211.1.14
        inet6 fe80::df47:a617:1626:7015  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
        RX packets 241  bytes 80795 (80.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1403  bytes 182631 (182.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tun1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.234.12.25  netmask 255.255.255.255  destination 10.234.12.26
        inet6 fe80::4eda:1f4e:3ec4:def5  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
        RX packets 8  bytes 1739 (1.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 1248 (1.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


0.0.0.0/1 via 10.234.11.250 dev tun1 
10.211.1.14 dev tun0 proto kernel scope link src 10.211.1.13 
10.234.11.250 dev tun1 proto kernel scope link src 10.234.11.249 
128.0.0.0/1 via 10.234.11.250 dev tun1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-07-16
@rPman

the dev directive should point to tap0 and tap1 in the corresponding configs
, and also, you need to look at the errors in the logs, /var/log/*openvpn* (as far as I remember, the log name corresponds to the name of the config file and / or the service that openvpn is running on)
ps write route for the subnets of the vpn provider so that the traffic of the second does not go through the first open vpn

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question