UCARP(8) | System Manager's Manual | UCARP(8) |
ucarp — Automatic IP failover
ucarp [-i, --interface=INTERFACE]
[-s, --srcip=IPADDRESS]
[-v, --vhid=VHID] [-p, --pass=PASSWORD]
[-o, --passfile=PASSFILE]
[-P, --preempt] [-n, --neutral] [-a,
--addr=IPADDR] [-h, --help]
[-b, --advbase=SECS] [-k,
--advskew=SKEW] [-u,
--upscript=SCRIPT]
[-d, --downscript=SCRIPT] [-r,
--deadratio=RATIO] [-z, --shutdown]
[-B, --daemonize] [-f, --facility=FACILITY]
[-x, --xparam PARAM]
[-S, --ignoreifstate] [-M, --nomcast]
ucarp allows a pair of hosts to share common IP addresses in order to provide automatic failover of an address from one machine to another. It is a portable userland implementation of the secure and patent-free Common Address Redundancy Protocol, (CARP), OpenBSD's alternative to VRRP.
ucarp supports the following command line options:
A host with a real IP of 10.1.1.10 configured to be the master in a preemptive configuration with a virtual IP of 10.1.1.252.
ucarp -i eth0 -s 10.1.1.10 -v 10 -p secret -a 10.1.1.252 \ --upscript=/etc/vip-up.sh --downscript=/etc/vip-down.sh -P
The backup might be configured something like this.
ucarp -i eth0 -s 10.1.1.11 -v 10 -p secret -a 10.1.1.252 \ --upscript=/etc/vip-up.sh --downscript=/etc/vip-down.sh
A machine with a real IP of 192.168.1.19 is the preferred master for a virtual IP of 10.1.12.7, broadcasts are sent every 5 seconds.
ucarp -b 5 -s 192.168.1.19 -v 27 -p badpass -a 10.1.12.7 \ -u /etc/vip-up.sh -d /etc/vip-down.sh -z
The hot standby with an IP of 192.168.1.20 uses the following command, (note the advskew of 50 putting it at a disadvantage and making the first machine preferred).
ucarp -b 5 -k 50 -s 192.168.1.20 -v 27 -p badpass -a 10.1.12.7 \ -u /etc/vip-up.sh -d /etc/vip-down.sh -z
Sending the ucarp process a SIGUSR1 will have it log a status line to syslog, eg "Sep 13 12:59:56 localhost ucarp[2654]: [INFO] MASTER on eth0 id 1" or "Sep 13 13:00:25 localhost ucarp[2644]: [INFO] BACKUP on eth0 id 1"
Sending the ucarp process a SIGUSR2 will cause it to demote itself from master to backup, pause 3 seconds, then proceed as usual to listen for other masters, and promote itself if necessary. This could be useful if you wish another node to take over master.
ucarp was written by Frank Denis, <j@ucarp.org>.
This manual page was written by Eric Evans <eevans@debian.org> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.