Reg Connection Tracking
HI,
I have registered on my yahoo Id on this List as suggested by some on this list due to disclaimer issue. I am attaching my mail here.
Hi List,
I am new to this list and Getting some problem in connection tracking. However, I have put it on Netfilter users list but it is not solved so I am putting it here for your suggestions.
Well The setup is like this : -
I am having a RG(Residential Gateway) and inhome client. RG is using Embedix kernel with 2.4.3 sources.
The /proc/sys is not present as CONFIG_SYSCTL is not enabled due to some reasons. It means there is none of the ip_conntrack_max file present. RG is having IPFILTER as firewall and having iptables rules to allow the traffic in and outside. RG is having 2 interfaces.
One is internal to connect the RG to inhome.
And Other is external for the internet.
When I tries to ping from inhome to RG's external , I don't get reply. The reason is : - There is a rule on RG's side
-m state -state INVALID -j DROP
The ip_conntrack contains 1016 entries and it keeps printing the message :-ip_conntrack: Maximum limit of 1016 entries exceeded.
Even increasing the value of ip_conntrack_max in the code doesn't help. The ip_conntrack file consists of all unreplied packets b/w inhome and RG with icmp request type=8 code =0 and reply(inverse tuple) = type=0
code=0
Similarly the http b/w inhome and RG makes this file full . I am attaching the conversation which I had it on Netfilter users list. Please Help.
Thanks & Regards,
Amit Kr. Gupta.
------------------------------------------Conversation on netfilter users list which i had------- Amit,
This looks like a bug, so I guess you had better take this report to netfilter-devel with as much info as possible.
=20
Could you also cat a full ip_conntrack to a temp file
and put it somewhere online to accompany your bugreport.
=20
Reporting this to netfilter-devel doesn't guarantee that
you will get a quick solution to your problem
(your setup is quite different from most people's...),
but at least it could be put in the KNOWN-BUGS section
so someone could eventually get around to fixing this...
=20
Regards,
Filip
=20
Quoted 40 lines · Amit Kumar Gupta
=20
Hi List,
=20
Again Posting the same question ON the list As I have tried many ways=20 and didn't get any clues.
=20
As soon as I ping from inhome to the RG's internal, It just keep=20 filling theip_conntrackfile and it goes beyond ip_conntrack_max=20 entries. I don't know why Internal address is not replying. =20
If Any clues, Please Help.
=20
Thanks & Regards,
Amit
=20
-----Original Message-----
From: Amit Kumar Gupta
Sent: Saturday, January 11, 2003 10:37 AM
To: Athan
Cc: [email protected]
Subject: RE: Reg iptables Connection tracking
=20
Hi,
=20
I am using Embedix platform in which If I enableCONFIG_SYSCTL, the=20 image doesn't come up on the H/w. So I have to disable this.( There=20 has been some changes in the Kernel to suit this which works fine).=20 Now in conntrack module I don't have this option so my conntrack=20ctl_tablewill not be registered woth ipv4 table. So I was hardcoding=20 the value ofip_conntrack_max? Whether it will help?
=20
Another issue is I don't have enough memory on the board to have=20 sysctl command.
=20
Can you suggest something which I can do?
=20
Regards,
Amit
=20
=20
Quoted 6 lines · Amit Kumar Gupta
Quoted 5 lines · you
Well I am able to see upto this point. I went through the code flow=20 also. But I don't know why it prints the message(Even if increasing=20 the value from 1016 to 4096 by hardcoding it in the kernel). Another
issue is I don't know how it is taking 1016. As There is no
/proc/sys=20
Quoted 1 line
Quoted 1 line
, and by default it shoud take 0.
=20
I missed this before, sorry. Is this due to specifically disabling
/proc and/or specifically not mounting it for security reasons? If not, just enable it and mount it already.
=20
Quoted 3 lines
Not that this helps much. The real problem is WHAT is the conntrack table filling with. And I suspect it may be nothing, that you have a=20 problem because it is trying to use
/proc/net/conntrackand there IS
no=20
Quoted 3 lines
/proc/net/conntrack. The message may be triggering incorrectly,=20 presuming that since it cannot write another entry to=20/proc/net/conntrackthat the table is full.
=20
Er, no. That's not what /proc/net/ip_conntrack is. It doesn't EXIST
as such until you try to read from it. All of /proc is virtual. Just because you have no /proc and can't get at 'files' in it doesn't mean the SOURCE of their data doesn't exist.
=20
Quoted 2 lines
/proc in order to work. If I think of something else I'll email you again. Sorry.
=20
I'd certainly recommend having /proc around as well. There's thesysctl() interface for querying/changing some values too. Aha! You can set net/ipv4/ip_conntrack_max from this too *8-):
=20
sysctl -w net/ipv4/ip_conntrack_max=3D32768
=20
If your kernel doesn't have the sysctl support then, er, you're kind of shooting yourself in the foot for tuning things at ALL, including things like turning IP forwarding on and off, global TCP ECN support, SYN cookies etc....
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Things to verify:
1. Do you have local NAT on i.e. NAT for traffic from the machine itself ?
2. Is your ping packet being created in the proper manner ?
Sounds like your request packets and reply packets are being seen by the netfilter on two different interface. or the ping packet contents that are used by conntrack are not being created correctly. e.g type, id and code. If any of those are messed up, your conntrack will start going beserk cos the replies cannot be matched back to the original traffic.
Look at the CONFIG_IP_NF_LOCAL_NAT option and your routing tables. Do you have any static routes or other conditions that can asymmetric routing ?
Ranjeet.
Hi,
Well First thing is I am not using LOCAL NAT. I am using NAT for the external outgoing traffic from inhome and RG uses that to convert to valid IP address. Another thing is I am not using NAT available with LINUX. We have wriiten our own NAT, which we have already tested. Answer to 2nd que is :- I don't know whether ping packet is properly created.
I also think that ping packet is not getting created properly but i am not sure. I am not using static routing. Well in certain conditions we can switch on the asymmetric routing, but we are not hitting those conditions now.
We have already tested however this stuff on one test setup and this is the second one on which the differences are :-
(1) Different vedor board which i think will not have any effect.
(2) Different Linux Source version. Previously we tested with 2.4.2 and 2.4.5 sources and here it's 2.4.3
(3) CONFIG_SYSCTL is disabled.
But i think the above 3 changes should not effect it.
Regards,
Amit
Ranjeet Shetye <[email protected]> wrote:
Things to verify:
1. Do you have local NAT on i.e. NAT for traffic from the machine itself ?
2. Is your ping packet being created in the proper manner ?
Sounds like your request packets and reply packets are being seen by the netfilter on two different interface. or the ping packet contents that are used by conntrack are not being created correctly. e.g type, id and code. If any of those are messed up, your conntrack will start going beserk cos the replies cannot be matched back to the original traffic.
Look at the CONFIG_IP_NF_LOCAL_NAT option and your routing tables. Do you have any static routes or other conditions that can asymmetric routing ?
Ranjeet.
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Hi,
If you've written your own NAT, then I guess my answers can only be generic at best, cos I dont know the details of your NAT implementation e.g. what part of the ICMP packet is used to uniquely identify a flow of ICMP packets, how do you do conn-tracking for the NAT, etc. Sorry about that.
I'll think about this and come up with some more Q/A if I can.
Is your ping utility a standard issue ping from the linux/gnu/bsd suite or is that also something you guys have written on your own ?
Did your first test setup work flawlessly ? and only the second one has problems ? or did they both have problems ?
take care,
Ranjeet.
Quoted 38 lines · Amit Kumar
Hi,
Well First thing is I am not using LOCAL NAT. I am using NAT for the external outgoing traffic from inhome and RG uses that to convert to valid IP address. Another thing is I am not using NAT available with LINUX. We have wriiten our own NAT, which we have already tested. Answer to 2nd que is :- I don't know whether ping packet is properly created.
I also think that ping packet is not getting created properly but i am not sure. I am not using static routing. Well in certain conditions we can switch on the asymmetric routing, but we are not hitting those conditions now.
We have already tested however this stuff on one test setup and this is the second one on which the differences are :-
(1) Different vedor board which i think will not have any effect.
(2) Different Linux Source version. Previously we tested with 2.4.2 and 2.4.5 sources and here it's 2.4.3
(3)CONFIG_SYSCTLis disabled.
But i think the above 3 changes should not effect it.
Regards,
AmitRanjeet Shetye <[email protected]> wrote:
Things to verify:
1. Do you have local NAT on i.e. NAT for traffic from the machine itself ?
2. Is your ping packet being created in the proper manner ?Sounds like your request packets and reply packets are being seen by the netfilter on two different interface. or the ping packet contents that are used by conntrack are not being created correctly. e.g type, id and code. If any of those are messed up, your conntrack will start going beserk cos the replies cannot be matched back to the original traffic.
Look at the
CONFIG_IP_NF_LOCAL_NAToption and your routing tables. Do you have any static routes or other conditions that can asymmetric routing ?Ranjeet.
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
HI List,
Thanks for ur suggestions List.
Well, Now Again I tested the firewall and this time without NAT.
So it means that connection tracking is used only for the iptables cases. Even in that case i have the same problem. My first setup has worked flawlessly and only second one has problems. Another thing is I am using standard PING utility.
Now can anybody give suggestions why connection tracking is not working properly.
I have gone through the connection tracking code also and enabled the kernel debug messages. I saw that as soon as i ping or do some http connection(I am doing this only not tried others as i feel i will get same problem with other services), it keep printing, creating conntrack but it never destroys. Any suggestions, now?
Thanks & Regards,
Amit Kumar Gupta.
Ranjeet Shetye <[email protected]> wrote:
Hi,
If you've written your own NAT, then I guess my answers can only be generic at best, cos I dont know the details of your NAT implementation e.g. what part of the ICMP packet is used to uniquely identify a flow of ICMP packets, how do you do conn-tracking for the NAT, etc. Sorry about that.
I'll think about this and come up with some more Q/A if I can.
Is your ping utility a standard issue ping from the linux/gnu/bsd suite or is that also something you guys have written on your own ?
Did your first test setup work flawlessly ? and only the second one has problems ? or did they both have problems ?
take care,
Ranjeet.
Quoted 35 lines · Amit Kumar
Hi,
Well First thing is I am not using LOCAL NAT. I am using NAT for the external outgoing traffic from inhome and RG uses that to convert to valid IP address. Another thing is I am not using NAT available with LINUX. We have wriiten our own NAT, which we have already tested. Answer to 2nd que is :- I don't know whether ping packet is properly created.
I also think that ping packet is not getting created properly but i am not sure. I am not using static routing. Well in certain conditions we can switch on the asymmetric routing, but we are not hitting those conditions now.
We have already tested however this stuff on one test setup and this is the second one on which the differences are :-
(1) Different vedor board which i think will not have any effect.
(2) Different Linux Source version. Previously we tested with 2.4.2 and 2.4.5 sources and here it's 2.4.3
(3)CONFIG_SYSCTLis disabled.
But i think the above 3 changes should not effect it.
Regards,
AmitRanjeet Shetye wrote:
Things to verify:
1. Do you have local NAT on i.e. NAT for traffic from the machine itself ?
2. Is your ping packet being created in the proper manner ?Sounds like your request packets and reply packets are being seen by the netfilter on two different interface. or the ping packet contents that are used by conntrack are not being created correctly. e.g type, id and code. If any of those are messed up, your conntrack will start going beserk cos the replies cannot be matched back to the original traffic.
Look at the
CONFIG_IP_NF_LOCAL_NAToption and your routing tables. Do you have any static routes or other conditions that can asymmetric routing ?Ranjeet.
Quoted 3 lines
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Quoted 8 lines · Amit Kumar
HI List,
Thanks for ur suggestions List.
Well, Now Again I tested the firewall and this time without NAT. So it means that connection tracking is used only for the iptables cases. Even in that case i have the same problem. My first setup has worked flawlessly and only second one has problems. Another thing is I am using standard PING utility.
please use a more recent version of the linux kernel. Even I am unable to reacall what number of bugs 2.4.3 had in the netfilter code, and how we have solved them since then.
If this is impossible, please try to [at least] use one of the older patch-o-matic versions [like iptables-1.2.5 or something] which still support 2.4.3. Apply all 'pending' patches (which includes the 'submitted' ones).
Signature · 5 lines
Live long and prosper - Harald Welte / [email protected] http://www.gnumonks.org/ ============================================================================ GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)