-   Linux - Networking (
-   -   IPVS loadbalancing and IPTABLES Firewall issues (

yaw55555 04-01-2009 11:29 AM

IPVS loadbalancing and IPTABLES Firewall issues
Hi all,
I have set up an IPVS loadbalancing for Web traffic that is working perfectly.

But now, I try to run my usual firewall script (IPTABLES commands) on the director server and packets seem to be blocked while being sent to Apache server.

firewall script looks like :

iptables -t filter -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp --dport 80 -j ACCEPT
iptables -t filter -A FORWARD -p tcp --dport 80 -j ACCEPT

I can notice with ipvsadm counters that my http queries are taken into acccount and that director try to send packets to final server ..but nothing arrives on the Apache server.

Maybe IPTABLES and IPVS are not compliant ?
Many thanks for your ideas,

yaw55555 04-06-2009 05:27 AM

Hi all,
I cannot believe that I am the first to try IPVS and IPTABLES mixing...

I'm able to see that even without Firewalling, IPTABLES logs only INPUT packets (destinated to Virtual IP) , but no FORWARD or OUTPUT ..

So, if IPTABLES does not see OUTPUT packets, I am wondering why it blocks IPVS redirection.

Please help ...

AlekZandre 12-05-2012 11:36 AM

I've solved this problem by adding iptables rule that ACCEPT packets with state NEW and INVALID from source RealServer
Sorry, but I don't know exactly which chain could be added this rule in, because I use one chain for INPUT and FORWARD:

iptables -t filter -A INPUT-FORWARD -m state --state NEW,INVALID -m tcp -p tcp -s source --sport source_port -j ACCEPT

source and source_port are Real Servers and Ports that used in IPVS (LVS). For simplicity, I use source_net instead few sources

Hope it will help somebody!

By the way I use LVS-NAT

All times are GMT -5. The time now is 04:15 PM.