Linux Netfilter discussions
 help / color / mirror / Atom feed
* POSTROUTING SNAT only reply packets
@ 2011-01-17 10:16 GMail Isaac Gonzalez
  2011-01-17 10:38 ` Gáspár Lajos
  2011-01-17 23:07 ` Michael Vallaly
  0 siblings, 2 replies; 12+ messages in thread
From: GMail Isaac Gonzalez @ 2011-01-17 10:16 UTC (permalink / raw)
  To: netfilter

Hi,

I need to modify the reply packets of one web server to allow the 
connections between a webserver and client using a load balancer.

The client connections goes to a load balancer, the load balancer 
forwards the connection to a one web server changing the destination ip, 
the web server anwser the client with it's own ip address without 
passing again for the load balancer. In order to stablish the 
connection, the client needs to receive the web server answer with the 
correct ip address (in this case, the load balancer VIP address), in 
other case it receives ACK that it doesn't know about it and the 
connections is not ESTABLISHED.

I've doing some testing and seems that iptables only do SNAT on NEW 
connections, and I need to change the ip address of replied packets. 
Anybody know some workaround? If anobody do not know some workaround can 
you confirm that it's not posible to do this with iptables?

I've tried the next ip tables rules and only work when I do NEW 
connections from the web server.

-A POSTROUTING -o br0 -s WE_SERVER_ADDR -p tcp -m tcp --sport 80 --dport 
1024:65535 -j SNAT --to-source LOAD_BALANCER_ADDR

Thanks in advance.

Isaac González

^ permalink raw reply	[flat|nested] 12+ messages in thread
* POSTROUTING SNAT only reply packets
@ 2011-01-17 10:15 Isaac González
  0 siblings, 0 replies; 12+ messages in thread
From: Isaac González @ 2011-01-17 10:15 UTC (permalink / raw)
  To: netfilter

Hi,

I need to modify the reply packets of one web server to allow the 
connections between a webserver and client using a load balancer.

The client connections goes to a load balancer, the load balancer 
forwards the connection to a one web server changing the destination ip, 
the web server anwser the client with it's own ip address without 
passing again for the load balancer. In order to stablish the 
connection, the client needs to receive the web server answer with the 
correct ip address (in this case, the load balancer VIP address), in 
other case it receives ACK that it doesn't know about it and the 
connections is not ESTABLISHED.

I've doing some testing and seems that iptables only do SNAT on NEW 
connections, and I need to change the ip address of replied packets. 
Anybody know some workaround? If anobody do not know some workaround can 
you confirm that it's not posible to do this with iptables?

I've tried the next ip tables rules and only work when I do NEW 
connections from the web server.

-A POSTROUTING -o br0 -s WE_SERVER_ADDR -p tcp -m tcp --sport 80 --dport 
1024:65535 -j SNAT --to-source LOAD_BALANCER_ADDR

Thanks in advance.

Isaac González

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-01-17 23:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17 10:16 POSTROUTING SNAT only reply packets GMail Isaac Gonzalez
2011-01-17 10:38 ` Gáspár Lajos
2011-01-17 10:51   ` GMail Isaac Gonzalez
2011-01-17 11:14     ` Amos Jeffries
2011-01-17 10:55   ` Giles Coochey
2011-01-17 11:07     ` GMail Isaac Gonzalez
2011-01-17 11:36     ` Jan Engelhardt
2011-01-17 11:41       ` Giles Coochey
2011-01-17 11:57         ` GMail Isaac Gonzalez
2011-01-17 12:10           ` Jan Engelhardt
2011-01-17 23:07 ` Michael Vallaly
  -- strict thread matches above, loose matches on Subject: below --
2011-01-17 10:15 Isaac González

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox