环境:
centos 7.5
keepalived 1.4.5防火墙,SELinux均已关闭,主节点上可以看到vip生成,但是备节点以及其它服务器都无法ping通vip,keepalived 的vip可进行主备切换主节点配置:! Configuration File for keepalivedglobal_defs {
    notification_email {
        [email protected]
        [email protected]
        [email protected]
    }
    notification_email_from [email protected]
    smtp_server 127.0.0.1
    smtp_connect_timeout 30
    router_id LVS_DEVEL
}vrrp_instance VI_1 {
    state MASTER 
    interface eth0
    virtual_router_id 91
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    unicast_src_ip  192.168.126.11
    unicast_peer { 
                  192.168.126.12
                }
    virtual_ipaddress {
        192.168.126.100/24
    }
}备节点配置:! Configuration File for keepalivedglobal_defs {
    notification_email {
        [email protected]
        [email protected]
        [email protected]
    }
    notification_email_from [email protected]
    smtp_server 127.0.0.1
    smtp_connect_timeout 30
    router_id LVS_DEVEL
}vrrp_instance VI_1 {
    state BACKUP 
    interface eth0
    virtual_router_id 91
    priority 90
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    unicast_src_ip  192.168.126.12
    unicast_peer { 
                  192.168.126.11
                }
    virtual_ipaddress {
        192.168.126.100/24
    }
}[root@host1 keepalived]# systemctl status keepalived.service 
 keepalived.service - LVS and VRRP High Availability Monitor
   Loaded: loaded (/usr/lib/systemd/system/keepalived.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-07-26 21:32:01 EDT; 32min ago
  Process: 32453 ExecStart=/usr/local/keepalived/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 32454 (keepalived)
    Tasks: 3
   CGroup: /system.slice/keepalived.service
           32454 /usr/local/keepalived/sbin/keepalived -D
           32455 /usr/local/keepalived/sbin/keepalived -D
           32456 /usr/local/keepalived/sbin/keepalived -DJul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:03 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs...100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
Jul 26 21:32:08 host1 Keepalived_vrrp[32456]: Sending gratuitous ARP on eth0 for 192.168.126.100
[root@host2 keepalived]# systemctl status keepalived.service 
keepalived.service - LVS and VRRP High Availability Monitor
   Loaded: loaded (/usr/lib/systemd/system/keepalived.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-07-26 21:32:12 EDT; 32min ago
  Process: 4527 ExecStart=/usr/local/keepalived/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 4528 (keepalived)
    Tasks: 3
   CGroup: /system.slice/keepalived.service
           4528 /usr/local/keepalived/sbin/keepalived -D
           4529 /usr/local/keepalived/sbin/keepalived -D
           4530 /usr/local/keepalived/sbin/keepalived -DJul 26 21:32:12 host2 Keepalived_vrrp[4530]: Opening file '/etc/keepalived/keepalived.conf'.
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Initializing ipvs
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Gained quorum 1+0=1 <= 2 for VS [192.168.126...80
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Activating healthchecker for service [192.16...80
Jul 26 21:32:12 host2 Keepalived_healthcheckers[4529]: Activating healthchecker for service [192.16...80
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP_Instance(VI_1) removing protocol VIPs.
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: Using LinkWatch kernel netlink reflector...
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP_Instance(VI_1) Entering BACKUP STATE
Jul 26 21:32:12 host2 Keepalived_vrrp[4530]: VRRP sockpool: [ifindex(2), proto(112), unicast(1), f...1)]