到现在为止还挺好。 现在我想要将外部VIP(XXX.XXX.XXX.XXX)作为外部网站上的源IP。 所以当我从networking中的一个主机上运行curl ipinfo.io/ip时,我的VIP应该被返回。 目前,我得到一个网关的物理IP(ZZZ.ZZZ.ZZZ.ZZZ)。
这可能吗? 怎么样? 我可以在网关上将默认的gw设置为VIP吗?
keepalivedconfiguration
vrrp_script chk_LB { script "systemctl status nginx" interval 1 weight 50 fall 3 rise 5 } vrrp_instance VIP { state BACKUP garp_master_delay 3 garp_master_refresh 3 garp_master_refresh_repeat 2 priority 102 ! nopreempt interface eth1 virtual_router_id 1 advert_int 1 authentication { auth_type PASS auth_pass somePass } virtual_ipaddress { XXX.XXX.XXX.XXX dev eth0 YYY.YYY.YYY.YYY dev eth1 } track_interface { eth0 eth1 } track_script { chk_LB } notify /usr/local/bin/notify.sh }