Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables + ip_conntrack (required?)

Reply
Thread Tools Display Modes

iptables + ip_conntrack (required?)

 
 
Alan Williamson
Guest
Posts: n/a

 
      06-24-2008, 08:11 AM
I have been lurking on this group now for a while, and there does seem
to sound advice floating around. So with that, I tread into your waters
and ask for your assitance.

The setup is simple. nginx sitting on a Linux CentOS (2.6 kernel)
acting as a load balancer for a set of backend machines.

The machine is under quite a lot of network stress in terms of sockets
being setup and teared down again. We have iptables running to stop all
the nasty people in the world!

However, views seem to be divided on the ip_conntrack issue.

Some say to just increase the value if you are running out of handles.

echo 65536 > /proc/sys/net/ipv4/ip_conntrack_max

Some say to tune the values below their defaults so sockets get cleared
out quicker:

ip_conntrack_tcp_timeout_time_wait
ip_conntrack_tcp_timeout_fin_wait

Now some people say to remove ip_conntrack completely, its not required
for web traffic, especially for web balancers as you need double the
amount of sockets (one for the incoming and another for the backend).

iptables -t raw -A PREROUTING -p tcp --dport 80 -j NOTRACK


So my questions are:

1. Anyone have any experience with this world?
2. What is ip_conntrack really buying me for web traffic?
3. Is the NOTRACK the only way to turn off ip_conntrack?


All advice gratefully received and digested!

thanks

--
Alan Williamson
Registrationless email/sms reminders: http://yourli.st/
blog: http://alan.blog-city.com/
 
Reply With Quote
 
 
 
 
Pascal Hambourg
Guest
Posts: n/a

 
      06-24-2008, 02:23 PM
Hello,

Alan Williamson a écrit :
>
> Some say to just increase the value if you are running out of handles.
>
> echo 65536 > /proc/sys/net/ipv4/ip_conntrack_max
>
> Some say to tune the values below their defaults so sockets get cleared
> out quicker:
>
> ip_conntrack_tcp_timeout_time_wait
> ip_conntrack_tcp_timeout_fin_wait
>
> Now some people say to remove ip_conntrack completely, its not required
> for web traffic, especially for web balancers as you need double the
> amount of sockets (one for the incoming and another for the backend).
>
> iptables -t raw -A PREROUTING -p tcp --dport 80 -j NOTRACK


They're all wrong. Conntrack has nothing to do with sockets. If your box
runs out of sockets, you're looking into the wrong direction.

> 2. What is ip_conntrack really buying me for web traffic?


Conntrack tracks "connections" based on the packet flows it sees. It is
necessary for address/port translation (-j DNAT, SNAT, MASQUERADE,
REDIRECT...) and stateful filtering (-m state, conntrack). If you use
neither of these, you probably don't need conntrack.

> 3. Is the NOTRACK the only way to turn off ip_conntrack?


If ip_conntrack (or nf_conntrack in "recent" kernels) is built as a
module, you can just not load it. NOTRACK is just more selective in
allowing not to track some flows.
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NAT keep alive ip_conntrack Andreas Mueller Linux Networking 0 05-02-2009 01:51 PM
tcp timeouts and ip_conntrack nsa.usa@gmail.com Linux Networking 1 04-09-2007 06:49 PM
ip_conntrack garbage Jim Garrison Linux Networking 6 01-02-2006 01:32 PM
ip_conntrack not full but dropping Patrick Linux Networking 4 04-19-2005 12:29 AM
bridging fw + ip_conntrack didn't work Marco Mueller Linux Networking 1 07-01-2004 04:14 PM



1 2 3 4 5 6 7 8 9 10 11