N
N
Nikita2020-10-17 16:10:08
linux
Nikita, 2020-10-17 16:10:08

Linux OpenVPN client over backup WAN?

There is a router (CentOS),
network interfaces:
-WAN1
-WAN2
-LAN
default gateway WAN1
Masquerading is enabled for both WANs

There is also an OpenVPN client, in the config of which the connection server is specified as a dns hostname:
netherlands-amsterdam-ca-version-2 .expressnetw.com

Task: make an OpenVPN connection through WAN2, and then route some hosts from the local network through the VPN tunnel using iproute2 (Policy based routing)

------------
The option to find the IP address of the VPN server and add a static route to it before starting openvpn is not suitable, because when connecting, DNS will return one address, and when reconnecting (reconnect), there will be a new address request from openvpn and it may already be different.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2020-10-17
@ky0

The option to find the IP address of the VPN server and add a static route to it before starting openvpn is not suitable, because when connecting, DNS will return one address, and when reconnecting (reconnect), there will be a new address request from openvpn and it may already be different.

Well, let it be different. Resolve the domain, and add the resulting IP address to the route. It is written in two lines.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question