No host 1:
vrrp_instance VI_1 {
state MASTER
interface eth0
dont_track_primary
virtual_router_id 1
priority 150
advert_int 5
mcast_src_ip 172.16.40.1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.1/24 dev eth0
}
}
vrrp_instance VI_2 {
state BACKUP
interface eth0
dont_track_primary
virtual_router_id 5
priority 100
advert_int 5
mcast_src_ip 172.16.40.1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.2/24 dev eth0
}
}
No host 2:
vrrp_instance VI_1 {
state BACKUP
interface eth0
dont_track_primary
virtual_router_id 1
priority 100
advert_int 5
mcast_src_ip 172.16.40.2
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.1/24 dev eth0
}
}
vrpp_instance VI_2 {
state MASTER
interface eth0
dont_track_primary
virtual_router_id 5
priority 150
advert_int 5
mcast_src_ip 172.16.40.2
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.2/24 dev eth0
}
}
Para o não-auto-failback, observe o nopreempt na man page keepalived.conf, mas veja também: link