小编Dan*_*iel的帖子

虚拟 IP 上的 Keepalived 路由器无法访问

我已经设置 keepalived 来管理两个主机之间的虚拟 IP。

我的设置如下

Server #1: Hostname folmer, ip 192.168.0.1/22 dev p2p1
Server #2: Hostname flemming, ip 192.168.0.2/22 dev p2p1
VIP: 192.168.0.3/22
Run Code Online (Sandbox Code Playgroud)

Keepalived 正在工作,当一台服务器出现故障时,VIP 会在服务器之间切换。

问题:在本地网络上,我可以 ping 通 192.168.0.3,但是当我将默认路由设置为 192.168.0.3 而不是 192.168.0.1 时,我无法再通过服务器 #1 访问互联网。

服务器 #1 上的 Keepalived 配置:

global_defs {
    notification_email {
        [SNIP]
        [SNIP]
    }
    notification_email_from [SNIP]
    smtp_server 127.0.0.1
    smtp_connect_timeout 30
    router_id folmer
}
vrrp_instance VI_1 {
    state MASTER
    interface p2p1
    virtual_router_id 52
    priority 150
    advert_int 1
    garp_master_delay 2
    smtp_alert
    authentication {
        auth_type PASS
        auth_pass [SNIP] …
Run Code Online (Sandbox Code Playgroud)

routing keepalived

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

keepalived ×1

routing ×1