! Configuration File for keepalived

vrrp_sync_group VG1 {
  VI_2
  VI_3
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    lvs_sync_daemon_interface eth1
    virtual_router_id 51
    priority 150
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass grr02
    }
    virtual_ipaddress {
        192.168.200.16
        192.168.200.17
        192.168.200.18
    }
}

vrrp_instance VI_2 {
    interface eth0
    virtual_router_id 52
    priority 100
    advert_int 1
    virtual_ipaddress {
        192.168.200.19
        192.168.200.20
        192.168.200.21
    }
}

vrrp_instance VI_3 {
    interface eth1
    virtual_router_id 53
    priority 100
    advert_int 1
    virtual_ipaddress {
        192.168.201.19
        192.168.201.20
        192.168.201.21
    }
}

virtual_server 192.168.200.19 80 {
    delay_loop 20
    lb_algo rr
    lb_kind NAT
    persistence_timeout 50
    protocol TCP

    real_server 192.168.201.100 80 {
        weight 1
        TCP_CHECK {
            connect_timeout 3
        }
    }
}
