global_defs { router_id {{ .RouterID }} script_user root enable_script_security } vrrp_script chk_edgeguard { script "/usr/lib/edgeguard/keepalived-check.sh" interval 2 weight -50 fall 3 rise 2 } {{ if .GWCheckIP }} vrrp_script chk_gateway { script "/usr/lib/edgeguard/keepalived-gw-check.sh {{ .GWCheckIP }}" interval 5 weight -110 fall 2 rise 2 } {{ end }} {{ if .HBInterface }} vrrp_sync_group VG_1 { group { VI_1 VI_HB } } {{ end }} vrrp_instance VI_1 { state {{ .State }} interface {{ .Interface }} virtual_router_id {{ .RouterID }} priority {{ .Priority }} advert_int 1 {{ if .SrcIP }} unicast_src_ip {{ .SrcIP }} unicast_peer { {{ .PeerIP }} } {{ end }} authentication { auth_type PASS auth_pass {{ .AuthPass }} } virtual_ipaddress { {{ range .VIPs }} {{ .Address }}/{{ .Prefix }} dev {{ .Device }} {{ end }} } track_script { chk_edgeguard {{ if .GWCheckIP }} chk_gateway {{ end }} } notify_master "/usr/lib/edgeguard/keepalived-master.sh" notify_backup "/usr/lib/edgeguard/keepalived-backup.sh" notify_fault "/usr/lib/edgeguard/keepalived-backup.sh" } {{ if .HBInterface }} vrrp_instance VI_HB { state {{ .State }} interface {{ .HBInterface }} virtual_router_id {{ .HBRouterID }} priority {{ .Priority }} advert_int 1 {{ if .HBSrcIP }} unicast_src_ip {{ .HBSrcIP }} unicast_peer { {{ .HBPeerIP }} } {{ end }} authentication { auth_type PASS auth_pass {{ .AuthPass }} } } {{ end }}