Working VRRP
From NuclearCat's homepage
After crawling websites, manual pages, made working config for proxies.
Just change priority, and maybe state
global_defs {
notification_email {
admin@mail.com
}
# The address to use in the From: header
notification_email_from admin@mail.com
# The SMTP server to route mail through
smtp_server 1.1.1.1
# How long to wait for the mail server to respond
smtp_connect_timeout 30
# A descriptive name describing the router
router_id VRRP-director2
}
# Create a VRRP instance
vrrp_instance VRRP_ROUTER1 {
# The initial state to transition to. This option isn't
# really all that valuable, since an election will occur
# and the host with the highest priority will become
# the master. The priority is controlled with the priority
# configuration directive.
state BACKUP
# The interface keepalived will manage
interface eth0
mcast_src_ip 2.2.2.155
# The virtual router id number to assign the routers to
# ID SHOULD BE SAME ON REDUNDANT UNITS!
virtual_router_id 50
# The priority to assign to this device. This controls
# who will become the MASTER and BACKUP for a given
# VRRP instance.
# HIGHER - MORE CHANCE TO BECOME ACTIVE!
priority 150
# How many seconds to wait until a gratuitous arp is sent
garp_master_delay 2
# How often to send out VRRP advertisements
advert_int 1
# Execute a notification script when a host transitions to
# MASTER or BACKUP, or when a fault occurs. The arguments
# passed to the script are:
# $1 - "GROUP"|"INSTANCE"
# $2 = name of group or instance
# $3 = target state of transition
# Sample: VRRP-notification.sh VRRP_ROUTER1 BACKUP 100
notify_master "/config/proxy-up"
notify_backup "/config/proxy-down"
# Send an SMTP alert during a state transition
#smtp_alert
# Authenticate the remote endpoints via a simple
# username/password combination
authentication {
auth_type PASS
auth_pass 1533524254
}
# The virtual IP addresses to float between nodes. The
# label statement can be used to bring an interface
# online to represent the virtual IP.
virtual_ipaddress {
2.2.2.2/29 dev eth0 label eth0:0
}
}