vrrp_script chk_dhcp { script "/etc/keepalived/chk_dhcp.sh" interval 5 timeout 3 #weight -50 # 进程挂掉,降低 50 优先级,触发 VIP 迁移 fall 3 # 2 次失败后触发 rise 2 # 2 次检测成功后恢复 } vrrp_instance DHCP_VIP { state MASTER interface eth00 virtual_router_id 5 priority 120 advert_int 1 # max_auto_priority 255 authentication { auth_type PASS auth_pass 12345 } virtual_ipaddress { # 192.168.16.5/20 dev eth00 # DHCP 服务器的 VIP 192.168.16.5 # DHCP 服务器的 VIP } track_script { chk_dhcp } garp_master_delay 1 garp_master_repeat 5 # 发送 5 次 GARP notify_fault "/etc/keepalived/notify_handler.sh fault" notify_master "/etc/keepalived/notify_handler.sh master" notify_backup "/etc/keepalived/notify_handler.sh backup" }