Score:1

keepalived virtual and real server in different subnets

ru flag

My goal is to forward the SMTP traffic from one unused server to another using keepalived. The problem is, that the other SMTP server is in different subnet. I have configured keepalive in the following way.

virtual_server 192.168.111.111 25 {
        delay_loop 10
        lb_algo rr
        lb_kind DR
        protocol TCP

        real_server 192.168.222.222 25 {
                weight 1
                SMTP_CHECK {
                        connect_timeout 5
                        retry 3
                        delay_before_retry 5
                        helo_name "lb-lan-1.local"
                }
        }

        real_server 192.168.222.223 25 {
                weight 1
                SMTP_CHECK {
                        connect_timeout 5
                        retry 3
                        delay_before_retry 5
                        helo_name "lb-lan-1.local"
                }
        }
}

However, it seems that this setup does not work for some reason. Is there a way to configure virtual and real IP in keepalive, but in different subnets?

Another workaround (i.e. OS settings) would be also considered as acceptable solution.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.