.TH keepalived.conf 5 2020-05-31 "Keepalived" "Keepalived Configuration's Manual" .SH NAME keepalived.conf - configuration file for Keepalived .br .SH DESCRIPTION \fBkeepalived.conf\fR is the configuration file which describes all the Keepalived keywords. Keywords are placed in hierarchies of blocks and subblocks, each layer being delimited by '{' and '}' pairs. .PP Comments start with '#' or '!' to the end of the line and can start anywhere in a line. .PP The keyword 'include' allows inclusion of other configuration files from within the main configuration file, or from subsequently included files. .PP The format of the include directive is: \fBinclude\fR FILENAME .PP FILENAME can be a fully qualified or relative pathname, and can include wildcards, including csh style brace expressions such as "{foo/{,cat,dog},bar}" if glob() supports them. .PP After opening an included file, the current directory is set to the directory of the file itself, so any relative paths included from a file are relative to the directory of the including file itself. .PP \fBNote:\fR This documentation MUST be considered as THE exhaustive source of information in order to configure Keepalived. This documenation is supported and maintained by Keepalived Core-Team. .PP .SH PARAMETER SYNTAX \fB\fR is one of on|off|true|false|yes|no .br \fB\fR is a time value in seconds, including fractional seconds, e.g. 2.71828 or 3; resolution of timer is micro-seconds. .SH SCRIPTS There are three classes of scripts can be configured to be executed. (a) Notify scripts that are run when a vrrp instance or vrrp group changes state, or a virtual server quorum changes between up and down. (b) vrrp tracking scripts that will cause vrrp instances to go down it they exit a non-zero exist status, or if a weight is specified will add or subtract the weight to/from the priority of that vrrp instance. (c) LVS checker misc scripts that will cause a real server to be configured down if they exit with a non-zero status. By default the scripts will be executed by user keepalived_script if that user exists, or if not by root, but for each script the user/group under which it is to be executed can be specified. There are significant security implications if scripts are executed with root privileges, especially if the scripts themselves are modifiable or replaceable by a non root user. Consequently, security checks are made at startup to ensure that if a script is executed by root, then it cannot be modified or replaced by a non root user. All scripts should be written so that they will terminate on receipt of a SIGTERM signal. Scripts will be sent SIGTERM if their parent terminates, or it is a script the keepalived is awaiting its exit status and it has run for too long. .PP .SH Quoted strings Quoted strings are specified between " characters; more specifically a string will only end after a quoted string if there is whitespace afterwards. For example: .nf .RS "abcd" efg h jkl "mnop" .RE .fi will be the single string "abcd efg h jkl mnop", i.e. the embedded " characters are removed. .PP Quoted strings can also have escaped characters, like the shell. \\a, \\b, \\E, \\f, \\n, \\r, \\t, \\v, \\nnn and \\xXX (where nnn is up to 3 octal digits, and XX is any sequence of hex digits) and \\cC (which produces the control version of character C) are all supported. \\C for any other character C is just treated as an escaped version of character C, so \\\\ is a \\ character and \\" will be a " character, but it won't start or terminate a quoted string. .PP For specifying scripts with parameters, unquoted spaces will separate the parameters. If it is required for a parameter to contain a space, it should be enclosed in single quotes ('). .PP .SH CONFIGURATION PARSER Traditionally the configuration file parser has not been one of the strengths of keepalived. Lot of efforts have been put to correct this even if this is not the primal goal of the project. .SH TOP HIERACHY .PP Keepalived configuration file is articulated around a set of configuration blocks. Each block is focusing and targetting a specific daemon family feature. These features are: .PP \fBGLOBAL CONFIGURATION\fR .PP \fBBFD CONFIGURATION\fR .PP \fBVRRPD CONFIGURATION\fR .PP \fBLVS CONFIGURATION\fR .SH GLOBAL CONFIGURATION contains subblocks of \fBGlobal definitions, Linkbeat interfaces, Static track groups, Static addresses, Static routes,\fR and \fBStatic rules\fR .PP .SH Global definitions .PP .nf # Following are global daemon facilities for running # keepalived in a separate network namespace: # -- # Set the network namespace to run in. # The directory /var/run/keepalived will be created as an # unshared mount point, for example for pid files. # syslog entries will have _NAME appended to the ident. # Note: the namespace cannot be changed on a configuration reload. \fBnet_namespace \fRNAME # Add the IPVS configuration in the specified net namespace. It allows to easily # split the VIP traffic on a given namespace and keep the healthchecks traffic # in another namespace. If NAME is not specified, then the default namespace # will be used. \fBnet_namespace_ipvs \fRNAME # ipsets wasn't network namespace aware until Linux 3.13, and so # if running with # an earlier version of the kernel, by default # use of ipsets is disabled if using a namespace and vrrp_ipsets # has not been specified. This options overrides the default and # allows ipsets to be used with a namespace on kernels prior to 3.13. \fBnamespace_with_ipsets\fR # If multiple instances of keepalived are run in the same namespace, # this will create pid files with NAME as part of the file names, # in /var/run/keepalived. # Note: the instance name cannot be changed on a configuration reload \fBinstance \fRNAME # Create pid files in /var/run/keepalived \fBuse_pid_dir\fR # Poll to detect media link failure using ETHTOOL, MII or ioctl interface # otherwise uses netlink interface. \fBlinkbeat_use_polling\fR # Time for main process to allow for child processes to exit on termination # in seconds. This can be needed for very large configurations. # (default: 5) \fBchild_wait_time \fRSECS # Global definitions configuration block \fBglobal_defs \fR{ # Set the process names of the keepalived processes to the default values: # keepalived, keepalived_vrrp, keepalived_ipvs, keepalived_bfd \fBprocess_names\fR # Specify the individual process names \fBprocess_name\fR NAME \fBvrrp_process_name\fR NAME \fBipvs_process_name\fR NAME \fBbfd_process_name\fR NAME # The startup and shutdown scripts are run once, when keepalived starts # before any child processes are run, and when keepalived stops after # all child processes have terminated, respectively. # The original motivation for adding this feature was that although # keepalived can setup IPVS configuration using firewall marks, there # was no mechanism for adding configuration to set the firewall marks # (or for removing it afterwards). # This feature can also be used to setup the iptables framework required # if using iptables (see vrrp_iptables option below), modify interface # settings, or anything else that can be done from a script or program. # Only one startup script and one shutdown script can be specified. # The timeouts (in seconds default 10 seconds) are the time allowed for # scripts to run; if the timeout expires the scripts will be killed (this # is to stop keepalived hanging waiting for the scripts to terminate). \fBstartup_script\fR SCRIPT_NAME [username [groupname]] \fBstartup_script_timeout\fR SECONDS # range [1,1000] \fBshutdown_script\fR SCRIPT_NAME [username [groupname]] \fBshutdown_script_timeout\fR SECONDS # range [1,1000] # Set of email To: notify \fBnotification_email \fR{ admin@example1.com ... } # email from address that will be in the header # (default: keepalived@) \fBnotification_email_from \fRadmin@example.com # Remote SMTP server used to send notification email. # IP address or domain name with optional port number. # (default port number: 25) \fBsmtp_server \fR127.0.0.1 [] # Name to use in HELO messages. # (default: local host name) \fBsmtp_helo_name \fR # SMTP server connection timeout in seconds. \fBsmtp_connect_timeout \fR30 # Sets default state for all smtp_alerts \fBsmtp_alert \fR # Sets default state for vrrp smtp_alerts \fBsmtp_alert_vrrp \fR # Sets default state for checker smtp_alerts \fBsmtp_alert_checker \fR # Logs every failed real server check in syslog # (nevertheless, SMTP alert is only sent when all retry checks failed # and real server transitions to DOWN state) \fBchecker_log_all_failures \fR # Don't send smtp alerts for fault conditions \fBno_email_faults\fR # String identifying the machine (doesn't have to be hostname). # (default: local host name) \fBrouter_id \fR # Multicast Group to use for IPv4 VRRP adverts # Defaults to the RFC5798 IANA assigned VRRP multicast address 224.0.0.18 # which You typically do not want to change. \fBvrrp_mcast_group4 \fR224.0.0.18 # Multicast Group to use for IPv6 VRRP adverts # (default: ff02::12) \fBvrrp_mcast_group6 \fRff02::12 # sets the default interface for static addresses. # (default: eth0) \fBdefault_interface \fRp33p1.3 # The sync daemon as provided by the IPVS kernel code only supports # one master and one backup daemon instance at a time to synchronize # the IPVS connection table. # See ipvsadm(8) man page for more details of the sync daemon. # Parameters are binding interface, and optional: # inst VRRP_INSTANCE (inst can be omitted for backward compatibility) # syncid (0 to 255) for lvs syncd, default is the VRID of vrrp instance, # or 0 if no vrrp instance # maxlen (1..65507) maximum packet length (limit is mtu - 20 - 8) # port (1..65535) UDP port number to use, default 8848 # ttl (1..255) # group - multicast group address(IPv4 or IPv6), default 224.0.0.81 # If VRRP_INSTANCE is not specified, both the master and backup sync daemons # will be run as long as keepalived is running, otherwise the sync daemon # master/backup state tracks the state of the specified vrrp instance: if # the vrrp instance is in master state, only the master sync daemon will run, # if the vrrp instance is not master, only the backup sync daemon will run. # NOTE: maxlen, port, ttl and group are only available on Linux 4.3 or later. # See kernel source doc/Documentation/networking/ipvs-sysctl.txt for details of # parameters controlling IPVS and the sync daemon. # /proc/net/ip_vs* provide some details about the state of IPVS. \fBlvs_sync_daemon \fR [[inst] ] [id ] \e [maxlen ] [port ] [ttl ] [group ] # lvs_timeouts specifies the tcp, tcp_fin and udp connection tracking timeouts # in seconds. At least one value must be specified; not setting a value leaves # it unchanged from when keepalived started. \fBlvs_timeouts\fR [tcp SECS] [tcpfin SECS] [udp SECS] # flush any existing LVS configuration at startup \fBlvs_flush\fR # flush remaining LVS configuration at shutdown # If VS is specified, remove each keepalived managed virtual # server without explicitly removing the real servers (the kernel will # remove them). \fBlvs_flush_onstop [VS]\fR # delay for second set of gratuitous ARPs after transition to MASTER. # in seconds, 0 for no second set. # (default: 5) \fBvrrp_garp_master_delay \fR10 # number of gratuitous ARP messages to send at a time after # transition to MASTER. # (default: 5) \fBvrrp_garp_master_repeat \fR1 # delay for second set of gratuitous ARPs after lower priority # advert received when MASTER. \fBvrrp_garp_lower_prio_delay \fR10 # number of gratuitous ARP messages to send at a time after # lower priority advert received when MASTER. \fBvrrp_garp_lower_prio_repeat \fR1 # minimum time interval for refreshing gratuitous ARPs while MASTER. # in seconds. # (default: 0 (no refreshing)) \fBvrrp_garp_master_refresh \fR60 # number of gratuitous ARP messages to send at a time while MASTER # (default: 1) \fBvrrp_garp_master_refresh_repeat \fR2 # Delay in ms between gratuitous ARP messages sent on an interface # decimal, seconds (resolution usecs). # (default: 0) \fBvrrp_garp_interval \fR0.001 # Delay in ms between unsolicited NA messages sent on an interface # decimal, seconds (resolution usecs). # (default: 0) \fBvrrp_gna_interval \fR0.000001 # By default keepalived sends 5 gratuitions ARP/NA messages at a # time, and after transitioning to MASTER sends a second block of # 5 messages 5 seconds later. # With modern switches this is unnecessary, so setting vrrp_min_garp # causes only one ARP/NA message to be sent, with no repeat 5 seconds # later. \fBvrrp_min_garp \fR[] # If a lower priority advert is received, don't send another advert. # This causes adherence to the RFCs. Defaults to false, unless # strict_mode is set. \fBvrrp_lower_prio_no_advert \fR[] # If we are master and receive a higher priority advert, send an advert # (which will be lower priority than the other master), before we # transition to backup. This means that if the other master has # garp_lower_priority_repeat set, it will resend garp messages. # This is to get around the problem of their having been two simultaneous # masters, and the last GARP messages seen were from us. \fBvrrp_higher_prio_send_advert \fR[] # Set the default VRRP version to use # (default: 2, but IPv6 instances will use version 3) \fBvrrp_version \fR<2 or 3> # keepalived uses a firewall (either nftables or iptables) for two purposes: # i) To implement no_accept mode # ii) To stop IGMP/MLD packets being sent on VMAC interfaces, and to move # them onto the underlying interface. # If both vrrp_iptables and vrrp_nftables are specified, keepalived will use # nftables and not iptables. Similarly, if the iptables command is generating # nftables configuration, or there is no iptables command installed, # keepalived will use nftables rather than iptables. # If neither vrrp_nftables or vrrp_iptables are specified but VMACs are in use # or no_accept is specified, keepalived will use nftables if it is available. # Use nftables as the firewall. # TABLENAME must not exist, and must be different for each # instance of keepalived running in the same network namespace. # Default tablename is keepalived, and priority is -1. # keepalived will create base chains in the table. # counters means counters are added to the rules (primarily for # debugging purposes). # ifindex means create IPv6 link local sets using ifindex rather # than ifnames. This is the default unless the vrrp_instance has # set dont_track_primary. The alternative is to use interface names # as part of the set key, but the nft utility prior to v0.8.3 will # then not output interface names properly. \fBnftables \fR[TABLENAME] \fBnftables_priority \fRPRIORITY \fBnftables_counters\fR \fBnftables_ifindex\fR # Use iptables as the firewall. # Note: it is necessary for the specified chain to exist in # the iptables and/or ip6tables configuration, and for the chain # to be called from an appropriate point in the iptables configuration. # It will probably be necessary to have this filtering after accepting # any ESTABLISHED,RELATED packets, because IPv4 might select the VIP as # the source address for outgoing connections. # (default: INPUT) \fBvrrp_iptables \fRkeepalived # or for outbound filtering as well # Note, outbound filtering won't work with IPv4, since the VIP can be # selected as the source address for an outgoing connection. With IPv6 # this is unlikely since the addresses are deprecated. \fBvrrp_iptables \fRkeepalived_in keepalived_out # or to to use default chains (INPUT and OUTPUT) \fBvrrp_iptables\fR # Keepalived may have the option to use ipsets in conjunction with # iptables. If so, then the ipset names can be specified, defaults # as below. If no names are specified, ipsets will not be used, # otherwise any omitted names will be constructed by adding "_if" # and/or "6" and _igmp/_mld to previously specified names. \fBvrrp_ipsets \fR[keepalived [keepalived6 [keepalived_if6 [keepalived_igmp [keepalived_mld]]]]] # The following enables checking that when in unicast mode, the # source address of a VRRP packet is one of our unicast peers. \fBvrrp_check_unicast_src\fR # Checking all the addresses in a received VRRP advert can be time # consuming. Setting this flag means the check won't be carried out # if the advert is from the same master router as the previous advert # received. # (default: don't skip) \fBvrrp_skip_check_adv_addr\fR # Enforce strict VRRP protocol compliance. This will prohibit: # 0 VIPs # unicast peers # IPv6 addresses in VRRP version 2 \fBvrrp_strict\fR # Send vrrp instance priority notifications on notify FIFOs. \fBvrrp_notify_priority_changes\fR # The following options can be used if vrrp, checker or bfd processes # are timing out. This can be seen by a backup vrrp instance becoming # master even when the master is still running, because the master or # backup system is too busy to process vrrp packets. # -- # keepalived can, if it detects that it is not running sufficiently # soon after a timer should expire, increase its priority, first # of all switching to realtime scheduling, and if that is not # sufficient, it will then increase its realtime priority by one each # time it detects a further delay in running. If the event that realtime # scheduling is enabled, RLIMIT_RTTIME will be set, using the values for # {bfd,checker,vrrp}_rlimit_rttime (see below). These values may need # to be increased for slower processors. # -- # To limit the maximum increased automatic priority, specify the following # (0 doesn't use automatic priority increases, and is the default. -1 disables # the warning message at startup). Omitting the priority sets the maximum value. \fBmax_auto_priority\fR [<-1 to 99>] # 99 is really sched_get_priority_max(SCHED_RR) # Minimum delay in microseconds after timer expires before keeplalived is # scheduled after which the process priority will be auto incremented # (default is 1000000 usecs (1 second), maximum is 10000000 (10 seconds)) \fBmin_auto_priority_delay\fR # Set the vrrp child process priority (Negative values increase priority) \fBvrrp_priority \fR<-20 to 19> # Set the checker child process priority \fBchecker_priority \fR<-20 to 19> # Set the BFD child process priority \fBbfd_priority \fR<-20 to 19> # Set the vrrp child process non swappable \fBvrrp_no_swap\fR # Set the checker child process non swappable \fBchecker_no_swap\fR # Set the BFD child process non swappable \fBbfd_no_swap\fR # The following options can be used to force vrrp, checker and bfd # processes to run on a restricted CPU set. # You can either bind processes to a single CPU or define a set of # cpu. In that last case Linux kernel will be restricted to that cpu # set during scheduling. Forcing process binding to single CPU can # increase performances on heavy loaded box. # INTEGER following configuration keyword are representing cpu_id # as shown in /proc/cpuinfo on line "processor:" # -- # Set CPU Affinity for the vrrp child process \fBvrrp_cpu_affinity\fR []...[] # Set CPU Affinity for the checker child process \fBchecker_cpu_affinity\fR []...[] # Set CPU Affinity for the bfd child process \fBbfd_cpu_affinity\fR []...[] # Set the vrrp child process to use real-time scheduling # at the specified priority \fBvrrp_rt_priority \fR<1..99> # Set the checker child process to use real-time scheduling # at the specified priority \fBchecker_rt_priority \fR<1..99> # Set the BFD child process to use real-time scheduling # at the specified priority \fBbfd_rt_priority \fR<1..99> # Set the limit on CPU time between blocking system calls, # in microseconds # (default: 10000) \fBvrrp_rlimit_rttime \fR>=2 \fBchecker_rlimit_rttime \fR>=2 \fBbfd_rlimit_rttime \fR>=2 # If Keepalived has been build with SNMP support, the following # keywords are available. # Note: Keepalived, checker and RFC support can be individually # enabled/disabled # -- # Specify socket to use for connecting to SNMP master agent # (see source module keepalived/vrrp/vrrp_snmp.c for more details) # (default: unix:/var/agentx/master) \fBsnmp_socket \fRudp:1.2.3.4:705 # enable SNMP handling of vrrp element of KEEPALIVED MIB \fBenable_snmp_vrrp\fR # enable SNMP handling of checker element of KEEPALIVED MIB \fBenable_snmp_checker\fR # enable SNMP handling of RFC2787 and RFC6527 VRRP MIBs \fBenable_snmp_rfc\fR # enable SNMP handling of RFC2787 VRRP MIB \fBenable_snmp_rfcv2\fR # enable SNMP handling of RFC6527 VRRP MIB \fBenable_snmp_rfcv3\fR # enable SNMP traps \fBenable_traps\fR # If Keepalived has been build with DBus support, the following # keywords are available. # -- # Enable the DBus interface \fBenable_dbus\fR # Name of DBus service # Useful if you want to run multiple keepalived processes with DBus enabled # (default: org.keepalived.Vrrp1) \fBdbus_service_name \fRSERVICE_NAME # Specify the default username/groupname to run scripts under. # If this option is not specified, the user defaults to keepalived_script # if that user exists, otherwise root. # If groupname is not specified, it defaults to the user's group. \fBscript_user \fRusername [groupname] # Don't run scripts configured to be run as root if any part of the path # is writable by a non-root user. \fBenable_script_security\fR # Rather than using notify scripts, specifying a fifo allows more # efficient processing of notify events, and guarantees that they # will be delivered in the correct sequence. # NOTE: the FIFO names must all be different # -- # FIFO to write notify events to # See vrrp_notify_fifo and lvs_notify_fifo for format of output # For further details, see the description under vrrp_sync_group. # see doc/samples/sample_notify_fifo.sh for sample usage. \fBnotify_fifo \fRFIFO_NAME [username [groupname]] # script to be run by keepalived to process notify events # The FIFO name will be passed to the script as the last parameter \fBnotify_fifo_script \fRSTRING|QUOTED_STRING [username [groupname]] # FIFO to write vrrp notify events to. # The string written will be a line of the form: INSTANCE "VI_1" MASTER 100 # and will be terminated with a new line character. # For further details of the output, see the description under vrrp_sync_group # and doc/samples/sample_notify_fifo.sh for sample usage. \fBvrrp_notify_fifo \fRFIFO_NAME [username [groupname]] # script to be run by keepalived to process vrrp notify events # The FIFO name will be passed to the script as the last parameter \fBvrrp_notify_fifo_script \fRSTRING|QUOTED_STRING [username [groupname]] # FIFO to write notify healthchecker events to # The string written will be a line of the form: # VS [192.168.201.15]:tcp:80 {UP|DOWN} # RS [1.2.3.4]:tcp:80 [192.168.201.15]:tcp:80 {UP|DOWN} # and will be terminated with a new line character. \fBlvs_notify_fifo \fRFIFO_NAME [username [groupname]] # script to be run by keepalived to process healthchecher notify events # The FIFO name will be passed to the script as the last parameter \fBlvs_notify_fifo_script \fRSTRING|QUOTED_STRING [username [groupname]] # Allow configuration to include interfaces that don't exist at startup. # This allows keepalived to work with interfaces that may be deleted and restored # and also allows virtual and static routes and rules on VMAC interfaces. # allow_if_changes allows an interface to be deleted and recreated with a # different type or underlying interface, eg changing from vlan to macvlan # or changing a macvlan from eth1 to eth2. This is predominantly used for # reporting duplicate VRID errors at startup if allow_if_changes is not set. \fBdynamic_interfaces [allow_if_changes]\fR # The following options are only needed for large configurations, where either # keepalived creates a large number of interface, or the system has a large # number of interface. These options only need using if # "Netlink: Receive buffer overrun" messages are seen in the system logs. # If the buffer size needed exceeds the value in /proc/sys/net/core/rmem_max # the corresponding force option will need to be set. # -- # Set netlink receive buffer size. This is useful for # very large configurations where a large number of interfaces exist, and # the initial read of the interfaces on the system causes a netlink buffer # overrun. \fBvrrp_netlink_cmd_rcv_bufs \fRBYTES \fBvrrp_netlink_cmd_rcv_bufs_force \fR \fBvrrp_netlink_monitor_rcv_bufs \fRBYTES \fBvrrp_netlink_monitor_rcv_bufs_force \fR # The vrrp netlink command and monitor socket the checker command and # and monitor socket and process monitor buffer sizes can be independently set. # The force flag means to use SO_RCVBUFFORCE, so that the buffer size # can exceed /proc/sys/net/core/rmem_max. \fBlvs_netlink_cmd_rcv_bufs \fRBYTES \fBlvs_netlink_cmd_rcv_bufs_force \fR \fBlvs_netlink_monitor_rcv_bufs \fRBYTES \fBlvs_netlink_monitor_rcv_bufs_force \fR # As a guide for process_monitor_rcv_bufs for 1400 processes terminating # simultaneously, 212992 (the default on some systems) is insufficient, whereas # 500000 is sufficient. \fBprocess_monitor_rcv_bufs \fRBYTES \fBprocess_monitor_rcv_bufs_force \fR # When a socket is opened, the kernel configures the max rx buffer size for # the socket to /proc/sys/net/core/rmem_default. On some systems this can be # very large, and even generally this can be much larger than necessary. # This isn't a problem so long as keepalived is reading all queued data from # it's sockets, but if rmem_default was set sufficiently large, and if for # some reason keepalived stopped reading, it could consume all system memory. # The vrrp_rx_bufs_policy allows configuring of the rx bufs size when the # sockets are opened. If the policy is MTU, the rx buf size is configured # to the total of interface's MTU * vrrp_rx_bufs_multiplier for each vrrp # instance using the socket. Likewise, if the policy is ADVERT, then it is # the total of each vrrp instances advert packet size * multiplier. # (default: use system default) \fBvrrp_rx_bufs_policy \fR[MTU|ADVERT|NUMBER] # (default: 3) \fBvrrp_rx_bufs_multiplier \fRNUMBER # Send notifies at startup for real servers that are starting up \fBrs_init_notifies\fR # Don't send an email every time a real server checker changes state; # only send email when a real server is added or removed \fBno_checker_emails\fR # The umask to use for creating files. The number can be specified in hex, octal # or decimal. BITS are I{R|W|X}{USR|GRP|OTH}, e.g. IRGRP, separated by '|'s. # The default umask is IWGRP | IWOTH. This option cannot override the # command-line option. \fBumask \fR[NUMBER|BITS] # On some systems when bond interfaces are created, they can start passing traffic # and then have a several second gap when they stop passing traffic inbound. This # can mean that if keepalived is started at boot time, i.e. at the same time as # bond interfaces are being created, keepalived doesn't receive adverts and hence # can become master despite an instance with higher priority sending adverts. # This option specifies a delay in seconds before vrrp instances start up after # keepalived starts, \fBvrrp_startup_delay \fR5.5 # The following will cause logging of receipt of VRRP adverts for VRIDs not configured # on the interface on which they are received. \fBlog_unknown_vrids\fR # Specify random seed for ${_RANDOM}, to make configurations repeatable (default # is to use a seed based on the time, so that each time a different configuration # will be generated). \fBrandom_seed \fRUNSIGNED_INT # reload_time_file allows a reload of keepalived to be scheduled in the future. This is # particularly useful if there is a master keepalived and one or more backup keepalived # instances and the new configuration is incompatible with the previous configuration, # e.g. adding or removing VIPs which would cause adverts to be rejected. # All the instances can be scheduled to reload at the same time, thereby ensuring that # no mismatching adverts are received by the backup instances. # The configuration specifies a file which keepalived will monitor. The first line of # the file must contain a valid time or date/time exactly in the formats specified below. # When keepalived starts up, it reads the file if it exists, and schedules a reload at # the specified time. If the file does not exist, then when it is subsequently created # a reload will be scheduled. If the file is updated, the reload time will be modified # accordingly. If the file is deleted, the reload is cancelled. # Normally when the reload occurs the specified file is deleted, since the reload has # been done; if the file included a date then the reload will be in the past and so # ignored. However, if there is no date, then if the file were reread following the # reload, a reload would be scheduled for 24 hours time. In order to stop this, the # file is deleted (unlinked) by default. If reload_repeat is specified, then the # file is not deleted, and if the file contains a time only with no date, then # keepalived will keep reloading at that time every day until the file is removed or # modified. # If the directory containing the file does not exist at startup/reload, or if the # directory is removed or renamed, then no future scheduled reloads will occur until # a manual (SIGHUP) reload is done or keepalived restarts. # The permitted formats of the entry in the timer file are precisely: # HH:MM:SS # YY-MM-DD HH:MM:SS # YYYY-MM-DD HH:MM:SS # each with an optional 'Z' at the end. # There must be no leading or trailing whitespace, and only one space between the date # and the time. # If there is a 'Z' at the end of the time, the time is parsed as UTC, otherwise the # time is the localtime for the environment in which keepalived is running. If the # systems which are being reloaded are in different timezones, it is probably safer to # use UTC. # If using local time with daylight savings, beware that some times don't exist and # some times are duplicated and hence ambiguous. \fBreload_time_file\fR ABSOLUTE-PATHNAME-OF-FILE \fBreload_repeat\fR } .fi .SH Linkbeat interfaces .PP The linkbeat_interfaces block allows specifying which interfaces should use polling via MII, Ethtool or ioctl status rather than rely on netlink status updates. This allows more granular control of global definition \fBlinkbeat_use_polling\fR. .PP This option is preferred over the deprecated use of \fBlinkbeat_use_polling\fR in a vrrp_instance block, since the latter only allows using linkbeat on the interface of the vrrp_instance itself, whereas \fRtrack_interface\fR and virtual_ipaddresses and virtual_iproutes may require monitoring other interfaces, which may need to use linkbeat polling. .PP The default polling type to use is MII, unless that isn't supported in which case ETHTOOL is used, and if that isn't supported then ioctl polling. The preferred type of polling to use can be specified with MII or ETHTOOL or IOCTL after the interface name, but if that type isn't supported, a supported type will be used. .PP The syntax for linkbeat_interfaces is: .nf \fBlinkbeat_interfaces\fR { eth2 enp2s0 ETHTOOL } .fi .SH Static track groups .PP Static track groups are used to allow vrrp instances to track static addresses, routes and rules. If a static address/route/rule specifies a track group, then if the address/route/rule is deleted and cannot be restored, the vrrp instance will transition to fault state. .PP The syntax for a track group is: .nf \fBtrack_group \fRGROUP1 { \fBgroup \fR{ VI_1 VI_2 } } .fi .SH Static routes/addresses/rules .PP Keepalived can configure static addresses, routes, and rules. These addresses are \fBNOT\fR moved by vrrpd, they stay on the machine. If you already have IPs and routes on your machines and your machines can ping each other, you don't need this section. The syntax for rules and routes is that same as for ip rule add/ip route add (except shortened option names are not supported due to ambiguities). The track_group specification refers to a named track_group which lists the vrrp instances which will track the address, i.e. if the address is deleted the vrrp instances will transition to backup. NOTE: since rules without preferences can be added in different orders due to vrrp instances transitioning from master to backup etc, rules need to have a preference. If a preference is not specified, keepalived will assign one, but it will probably not be what you want. .PP The syntax is the same for virtual addresses and virtual routes. If no dev element is specified, it defaults to default_interface (default eth0). Note: the broadcast address may be specified as '-' or '+' to clear or set the host bits of the address. .PP If a route or rule could apply to either IPv4 or IPv6 it will default to IPv4. To force a route/rule to be IPv6, add the keyword "inet6". .PP .nf \fBstatic_ipaddress \fR{ [/] [brd ] [dev ] [scope ] [label