S
S
sazhyk2018-11-27 14:56:29
openvpn
sazhyk, 2018-11-27 14:56:29

How to configure OPenvpn to 2 IP addresses?

Good afternoon.
There is a task, you need to configure the connection to the OpenVPN server according to the following conditions. The server hosting the OpenVPN server has 2 external IP addresses configured. Switching between them on unavailability is configured; there are primary and backup providers, when the primary is unavailable, the traffic goes through the backup channel, when the primary is restored, the traffic goes through it again. This is implemented by changing the default gateway. Let's say we have two external IPs: 1.1.1.1 - main and 2.2.2.2 - backup. Now the OpenVPN server is configured to use a single address, it is accessible from the external network at address 1.1.1.1. The client config says

...
remote 1.1.1.1 1194
...

On server
[email protected]:~# netstat -tulpanw4 | grep open
tcp        0      0 0.0.0.0:1194             0.0.0.0:*               LISTEN      28693/openvpn

Now the actual question. How should the client be configured and how the server should be, so that when switching to the backup communication channel on the server, the clients reconnect to the backup one, and when the main one appears, they switch back?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Softer, 2018-11-27
@Softer

https://community.openvpn.net/openvpn/wiki/Getting...

You can list multiple --remote options in the configuration file, and OpenVPN will try all of them until it gets a connection.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question