2

I have several servers connected to OpenVPN and I want to make a simple IP failover with a heartbeat, but I can't figure out how to assign a virtual OpenVPN IP.

Here is my config ha.cf on server1:

keepalive       2
deadtime        10
udpport         694
bcast           tun0
mcast           tun0 225.0.0.1 694 1 0
ucast           tun0 10.8.0.22
udp             tun0
logfacility     local0
node            server1
node            server2

Is it possible to configure a heartbeat in OpenVPN network?

NISMO1968
  • 897
  • 1
  • 6
  • 15
  • What's your underlying platform? CentOS? Ubuntu? – MadHatter Sep 23 '13 at 10:47
  • I use debian wheezy – Maxat Kulmanov Sep 23 '13 at 10:49
  • I'm no debian expert, but all the heartbeat versions I've used recently require some kind of resource manager on the back end; often `crm`. Do you know what you're using at the back end? – MadHatter Sep 23 '13 at 10:51
  • I have no idea about resource manager, I've just installed heartbeat with apt-get and configured two servers. Here is my config ha.cf on server1: keepalive 2 deadtime 10 udpport 694 bcast tun0 mcast tun0 225.0.0.1 694 1 0 ucast tun0 10.8.0.22 # What interfaces to heartbeat over? udp tun0 logfacility local0 node server1 node server2 – Maxat Kulmanov Sep 23 '13 at 10:56
  • I'm doing OpenVPN under HA right now, on CentOS - but it needs a back end to configure the controlled resources. I'm using crm. – MadHatter Sep 23 '13 at 12:57

1 Answers1

1

When I need to configure redundant OpenVPN service I usually use built-in support of multiple --remote options in client configuration file.

The OpenVPN client then tries to connect to a server in the order of these options. If there is a kind of network problem like disconnection from server a client will try to re-connect to a next server. The options ping and ping-restart help to detect such conditions if UDP protocol is used for communication.

dsmsk80
  • 5,817
  • 18
  • 22