<div class="gmail_quote">
<div>
<div class="h5">
<div class="gmail_quote">
<div><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">Hi,</font></font></span></div>
<div><span style="COLOR: #1f497d"><font size="3"><font face="Calibri"></font></font></span> </div>
<div><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">I was able to implement LVS with Direct Routing (iptables). </font></font></span></div>
<div><span style="COLOR: #1f497d"><font face="Calibri"><font size="3">I am facing a problem while using the iptables which requires </font>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3">iptables enrty on Real servers like this (iptables –t nat –A PREROUTING –p tcp –d <VIP> --dport <port> -j REDIRECT).</font></span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"></font></span> </p><span style="COLOR: #1f497d">
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3">Below is a brief on the setup:</font></span></p></span></font></span></div>
<div>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri"></font></font></span> </p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">I have 3 servers Apache installed on all three servers (Port 80).</font></font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font face="Calibri" size="3"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">Server 1 (10.50.57.22)  -> 10.50.57.55 (VIP) -> running “Pulse”</font></font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">Server 2 (10.50.57.40)</font></font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">Server 3 (10.50.57.48)</font></font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font face="Calibri" size="3"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">I have configured LVS on port 80.  Added the below iptables entry on 10.50.57.40 & 10.50.57.48</font></font></span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">iptables –t nat –A PREROUTING –p tcp –d 10.50.57.55 --dport 80 -j REDIRECT</font></font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font face="Calibri" size="3"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">With the above setup everything works fine. Even Apache on Server 1 (Which has the VIP) get the request as part of Load sharing.</font></font></span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font face="Calibri" size="3"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: red"><font size="3"><font face="Calibri">But if I add the iptables entry in Server 1 (10.50.57.22), Requests are received only on the Apache installed this host.</font></font></span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font face="Calibri" size="3"> </font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">The reason for doing this is to implement redundancy. Like in my case I have implemented the redundant setup on Server 2 (10.50.57.40) and once the “pulse” is stopped on Server 1(10.50.57.22), “pulse” is automatically started on Server 2 (10.50.57.40) which acquired the VIP (10.50.57.55). But since iptables is already active with the above entry all the requests are going to the Apache of same host (10.50.57.40).</font></font></span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri"></font></font></span> </p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font size="3"><font face="Calibri">Does anyone faced similar issue ?</font></font></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="COLOR: #1f497d"><font face="Calibri" size="3"></font></span> </p></div></div></div></div></div>