N
N
niknik112019-01-22 12:33:29
linux
niknik11, 2019-01-22 12:33:29

How to set up routing with two openvpn?

There are 2 openvpn servers: 10.0.0.1 (tun0) and 11.0.0.1 (tun1)
The first (tun0) serves exclusively for connecting computers to each other (client2client)
Through the second (tun1) you need to go to the Internet. Therefore, the second one has push "redirect-gateway def1 bypass-dhcp" in the settings.
And everything works, except for one thing: when you connect to the second server (tun1), the ping to the first (tun0) increases greatly. Apparently, the computer first looks for the ip of the first server through the interface of the second.
ip route:

0.0.0.0/1 via 11.0.0.1 dev tun1
default via 192.168.55.1 dev wlp2s0 proto dhcp metric 600 
10.0.0.0/24 via 10.0.0.9 dev tun0 
10.0.0.5 dev tun0 proto kernel scope link src 10.0.0.9 
11.0.0.0/24 dev tun1 proto kernel scope link src 11.0.0.9
128.0.0.0/1 via 11.0.0.1 dev tun1
192.168.55.0/24 dev wlp2s0 proto kernel scope link src 192.168.55.3 metric 600 
200.200.200.200 (<- public ip второго сервера) via 192.168.55.1 dev wlp2s0

I tried to remove the second server def1 from the push - it did not help
. How can I set up routing to go directly to the server 10.0.0.1 through tun0?
Ubuntu 18.10

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question