! Configuration File for keepalived

global_defs {

   script_user root
   enable_script_security
}

vrrp_script check_network {
    script "/etc/keepalived/check_ping.sh" 
    interval 5
    weight 50
    fall 3
    rise 3
    init_fail
    user root
}

vrrp_instance VI_SWLC {
    state  MASTER
    interface <interface>
    virtual_router_id 1
    track_script {
        check_network
    }
    track_interface {
        <interface> weight 50
    }
    priority 150
    advert_int 1
    nopreempt
    # Uncomment and comment "nopreempt" if preemption needed
    #preempt_delay 180
    authentication {
        auth_type PASS
        auth_pass eltex
    }
    virtual_ipaddress {
        <virtual_ip> dev <interface> label <interface>:1
    }

    notify_master "/etc/keepalived/keep_notify.sh master" 
    notify_backup "/etc/keepalived/keep_notify.sh backup" 
    notify_fault "/etc/keepalived/keep_notify.sh fault" 

    unicast_peer {
        <ip_адрес_другого_сервера>
    }
}
