linux-networking – Keepalived定期发送免费ARP

有没有办法让keepalived定期发送无偿ARP?

我们有以下情况:

>交换机故障(VLAN设置)
> keepalived failovered to backup instance
>备份实例发送免费ARP但思科ASA设备没有得到它(因为交换机故障)
>当交换机恢复时(几分钟后)VIP无法访问,因为ASA没有刷新ARP表(ARP表到期时间设置为4h)
>由于ASA已经从之前的活动节点获得了MAC,因此它没有发送ARP请求
>在我们重新启动keepalived实例启动新GARP之前,VIP无法访问

因此,我们认为我们可以通过定期GARP来避免这种情况.这是一个很好的方法,有没有办法在keepalived内做到这一点?

还有其他建议可以避免这种问题吗?

Keepalived配置:

global_defs {
   notification_email {
     email@address.com
   }

   notification_email_from SERVER_1
   smtp_server smtp.server.local
   smtp_connect_timeout 30
   router_id SERVER_1
}

vrrp_instance V1 {
    state BACKUP
    nopreempt
    interface eth0
    lvs_sync_daemon_interface eth0
    virtual_router_id 150
    priority 120
    advert_int 1
    persistence_timeout 0
    smtp_alert

    authentication {
        auth_type PASS
        auth_pass xxx
    }

    virtual_ipaddress {
    10.xxx.xxx.xxx
    }
}

解决方法

keepalived版本1.2.20及更高版本支持以下关于免费ARP的配置设置,vrrp_garp_master_refresh是我需要的.
# delay for second set of gratuitous ARPs after transition to MASTER
    vrrp_garp_master_delay 10    # seconds,default 5,0 for no second set

    # number of gratuitous ARP messages to send at a time after transition to MASTER
    vrrp_garp_master_repeat 1    # default 5

    # delay for second set of gratuitous ARPs after lower priority advert received when MASTER
    vrrp_garp_lower_prio_delay 10

    # number of gratuitous ARP messages to send at a time after lower priority advert received when MASTER
    vrrp_garp_lower_prio_repeat 1

    # minimum time interval for refreshing gratuitous ARPs while MASTER
    vrrp_garp_master_refresh 60  # secs,default 0 (no refreshing)

    # number of gratuitous ARP messages to send at a time while MASTER
    vrrp_garp_master_refresh_repeat 2 # default 1

    # Delay in ms between gratuitous ARP messages sent on an interface
    vrrp_garp_interval 0.001          # decimal,seconds (resolution usecs). Default 0.

    # Delay in ms between unsolicited NA messages sent on an interface
    vrrp_gna_interval 0.000001        # decimal,seconds (resolution usecs). Default 0.

相关文章

在Linux上编写运行C语言程序,经常会遇到程序崩溃、卡死等异...
git使用小结很多人可能和我一样,起初对git是一无所知的。我...
1. 操作系统环境、安装包准备 宿主机:Max OSX 10.10.5 虚拟...
因为业务系统需求,需要对web服务作nginx代理,在不断的尝试...
Linux模块机制浅析 Linux允许用户通过插入模块,实现干预内核...
一、Hadoop HA的Web页面访问 Hadoop开启HA后,会同时存在两个...