LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   NAT Routing for LVS Load Balancer (https://www.linuxquestions.org/questions/linux-networking-3/nat-routing-for-lvs-load-balancer-4175482406/)

FortressMvelez 10-27-2013 07:27 PM

NAT Routing for LVS Load Balancer
 
Hello,

I have been working on trying to set up a load balancer using CentOS 6, Piranha (GUI), Pulse and I think I got that part set but the problem I have is the load balancers can not see the real servers as you can see below:

Quote:

[root@lb1 ~]# ipvsadm --list
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 65.98.70.5:http wrr
This is a small break down of how I have it set up:

I have two load balancers LB1 and LB2

LB 1 has a public IP in eth0 of 65.98.x.x and a private IP of 10.0.0.3 in eth1

LB 2 has a public IP of 65.98.x.x in eth0 and a private IP of 10.0.0.4 on eth1

WEB1 has a private IP of 10.0.0.6 on eth0
WEB2 has a private IP of 10.0.0.7 on eth0
WEB3 has a private IP of 10.0.0.8 on eth0

The VIP is a public IP which is 65.98.x.x
The NAT Router IP is 10.0.0.1

The gateway configured for all three web servers is 10.0.0.1

I used these three iptables rules given to me to allow traffic between the lb servers and the web servers

Quote:


iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -o eth0 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A FORWARD -t filter -o eth0 -m state \
--state NEW,ESTABLISHED,RELATED -j ACCEPT

When everything was set, I restarted pulse on both lb servers. LB1 came up as the main load balancer and lb2 came up as the back up. When I log into any of the web servers and try to ping 4.2.2.2 or google.com I get the following:

Quote:


[root@web1 ~]# ping 4.2.2.2
PING 4.2.2.2 (4.2.2.2) 56(84) bytes of data.
From 10.0.0.3 icmp_seq=1 Destination Host Prohibited
From 10.0.0.3 icmp_seq=2 Destination Host Prohibited
From 10.0.0.3 icmp_seq=3 Destination Host Prohibited
^C
--- 4.2.2.2 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2335ms


I even tried shutting down iptables on the web servers but nothing still get the same thing. I believe it has something to do with iptables blocking something or needing another rule but I have been stuck here for some time now and I'm not sure what else to do.

Thank you in advance for any and all help!

FortressMvelez 10-28-2013 07:19 PM

No one replied so I'm closing it. Thanks for the help.....


All times are GMT -5. The time now is 05:43 AM.