Kamailio HA IP using keepalived - Omid-Mohajerani/Learn-Kamailio GitHub Wiki

MASTER:

vrrp_script check_kamailio {
  script    "/usr/bin/killall -0 /usr/sbin/kamailio"
  interval  1
  weight    2
  fall      20
  rise      10
}

vrrp_instance VI_1 {
    state		 MASTER
    interface		 ens192
    virtual_router_id 	 150
    priority		 101
    advert_int 		 1
    unicast_src_ip 10.252.212.61
    unicast_peer {
       10.252.212.62
    }
    authentication {
        auth_type PASS
        auth_pass 1212
    }
    track_script {
         check_kamailio
   }

    virtual_ipaddress {
        10.252.212.63/24  label ens192:1 dev ens192
    }
}

BACKUP:

vrrp_script check_kamailio {
  script    "/usr/bin/killall -0 /usr/sbin/kamailio"
  interval  1
  weight    2
  fall      20
  rise      10
}



vrrp_instance VI_1 {
    state		 BACKUP
    interface		 ens192
    virtual_router_id	 150
    priority		 100
    advert_int		 1
    unicast_src_ip 10.252.212.62
    unicast_peer {
       10.252.212.61
    }
    authentication {
        auth_type PASS
        auth_pass 1212
    }

    track_script {
         check_kamailio
    }

    virtual_ipaddress {
        10.252.212.63/24  label ens192:1 dev ens192
    }
}