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.