Thanks you pbd for answer.
I'm trying to create OpenVPN failover, but have issue with it.
On my FW1 and FW2 installed identical OpenVPN server with tha same configuration:
Code:
cd /usr/local/etc/openvpn/fe
client-config-dir /usr/local/etc/openvpn/fe/ccd
port 5556
local 1.1.1.1
proto udp
dev tun2
server 172.31.192.0 255.255.255.0
ifconfig 172.31.192.1 172.31.192.2
ca /usr/local/etc/openvpn/fe/keys/ca.crt
cert /usr/local/etc/openvpn/fe/keys/server.crt
key /usr/local/etc/openvpn/fe/keys/server.key
dh /usr/local/etc/openvpn/fe/keys/dh1024.pem
tls-server
tls-auth keys/ta.key 0
tls-timeout 120
auth MD5
comp-lzo
cipher BF-CBC # Blowfish (default)
keepalive 5 20
ping-timer-rem
persist-key
persist-tun
user nobody
group nobody
status /var/log/openvpn/fe-status.log
log /var/log/openvpn/fe.log
verb 3
mute 20
And have about 10 clients with following configuration:
Code:
client
dev tun1
proto udp
remote 1.1.1.1 5556
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
auth MD5
cipher BF-CBC
ns-cert-type server
comp-lzo
verb 3
mute 20
ca /etc/openvpn/fw/ca.crt
key /etc/openvpn/fw/f02.key
cert /etc/openvpn/fw/f02.crt
tls-client
tls-auth /etc/openvpn/fw/ta.key 1
log /var/log/openvpn/fw.log
script-security 3
up /etc/openvpn/fw/up_route.sh
keepalive 5 30
Where 1.1.1.1 is carp0 IP.
All evil lies in keepalive directive.
By default OpenVPN running on both boxes and bind to 1.1.1.1 carp0 IP.
After FW1 does down clients waits 30 secodns for answer from server, but FW2 as master don't know about this clients and keep silent.
After 30 seconds client will restart connection to server and will establish new connection to FW2.
Now all is ok and clients and server exchenged they keepalive pings.
In this time FW1 come back from reboot and take away master status for carp interface.
Now clients will recontects after 30 seconds with FW1.
!!!BUT FW2 still send keepalive ping packets to clients from 1.1.1.1 carp IP!!!!!
When FW2 send keepalive ping from 1.1.1.1 ip, switch change arp record for this IP and all traffic from clients will be send to FW2 for some time while FW1 don't send any packet from 1.1.1.1 IP to change arp recond on switch.
It's ugly.
I can stop it only by removing carp interfaces on FW2 for some time.