nf_conntrack
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 25 lines · you
Hi,
From: Davide Guerri <[email protected]>
Date: Fri, 20 Feb 2004 09:42:13 +0100Quoted 1 line
Hi, and sorry for my poor English.
Don't worry. me too.
Quoted 3 lines
I'm very interested in this project since I'm writing a NA(P)T-PT (as described in RFC 2766) implementation for Linux. Actually I'm a student (computer science, in Rome) and this will be my PhD thesis.
Great.
Quoted 2 lines
What happened to your code? I've downloaded USAGI Linux kernel, but I've found only your previous IPv6 conntrack. (very good work however!)
nf_conntrackis not in USAGI linux26. Of cause, I'll commit it to USAGI tree.After I sent
nf_conntrack, Mr. Harald Welte, who is a member of Netfilter Core Team, suggested that L3 part of conntrack (tuple, too) should be allocated dynamically.
Quoted 6 lines
Then I wrote "dynamic version" and sent it last year (December), but I suspend this work due to other work for a while. Fortunately, I could resume to this work. I'll evaluate 2 implementations, and decide which implementation is adopted.
After that, I'll commit
nf_conntrackto USAGI tree.
That's a great news.
I've tryed the second version of your nf_conntrack. It seems to work very well!
Quoted 10 lines
Quoted 4 lines
Is there some documentation on conntrack? I'm reading the existing NAT code, but it's quite difficult to understand. It's difficult for me because I don't yet completely understand the general behaviour of netfilter conntrack and the role of its tricky data structures.
Unfortunately, there isn't documentation about
nf_conntrack. But its scheme is mostly same asip_conntrack. The differences are tuple, new functions and arguments for Layer 3 header handling, and new module for Layer 3 protocols.
Quoted 5 lines
BTW, do you read Documentations at Netfilter Project web page ?
http://www.netfilter.org/documentation/index.html
"Netfilter Hacking HOWTO" may help you.
In the (very good) "Netfilter Hacking HOWTO" there are some infos on NAT, but I would need more detail.
However there is no problem, I'll study the netfilter code. ;)
Quoted 7 lines
Quoted 4 lines
I've also downloaded the
nf_conntrackpatch included in your post on netfilter-devel, I've applied it to a vanilla 2.6.0 Kernel and I'm going to try it. Prior to read that code, I would ask you if it can handle mixed IPv6-IPv4 tuples.Thank you for using
nf_conntrack. But you cannot handle mixed tuples (ex. src = IPv6, dst = IPv4) in now.
Sorry, I've expressed myself badly! What I need is to change the expected reply of the conntrack from an IPv4 tuple to an IPv6 tuple and vice versa. Hence what I would to know is if nf_conntrack can handles original-direction tuples of one type and reply-direction tuple of the other type (so that it will be possible to track a "NA(P)T-PT'ed connection").
Quoted 4 lines
You need to write NA(P)T-PT code based on
nf_conntrack. Maybe IPv4 NAT codes help you. The biggest issue is how pass packets from IPv4 stack to IPv6 stack and vice versa. I imagine that addresses in packets are mangled at only NF_IP{6}_PRE_ROUNTING, and then callednetif_rx().
That was my first idea. But I've seen some code that makes use ip_route_me_harder() + ip_output() for injecting IPv4 packets, and ip6_route_me_harder() + ip6_output for IPv6 packets.
I fear that with netif_rx() traslated packet would be tracked again, and this is not what I need. (I'm sorry but I'm still studying netfilter and conntrack (and English too ;) ) so it's likely that I'm wrong).
Quoted 2 lines
BTW, if allowed, could you Cc to netfilter-devel for other folks who interested in this area ?
I've just done it ;)
Quoted 4 lines
Regards,
-----------------------------------------------------------------
Yasuyuki KOZAKAI @ USAGI Project <[email protected]>
Thank you very much Yasuyuki for your work and for your quick reply!
Best regards,
Davide Guerri.
Signature · 1 line
T@1t
Hi,
From: Davide Guerri <[email protected]>
Date: Sun, 22 Feb 2004 11:10:28 +0100
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
I've also downloaded the
nf_conntrackpatch included in your post on netfilter-devel, I've applied it to a vanilla 2.6.0 Kernel and I'm going to try it. Prior to read that code, I would ask you if it can handle mixed IPv6-IPv4 tuples.
Quoted 8 lines
Quoted 2 lines
Thank you for using
nf_conntrack. But you cannot handle mixed tuples (ex. src = IPv6, dst = IPv4) in now.Sorry, I've expressed myself badly! What I need is to change the expected reply of the conntrack from an IPv4 tuple to an IPv6 tuple and vice versa. Hence what I would to know is if
nf_conntrackcan handles original-direction tuples of one type and reply-direction tuple of the other type (so that it will be possible to track a "NA(P)T-PT'ed connection").
You're right. I mistook.
Please assume that initiator is IPv4 node. Likely IPv4 NAT, nf_conntrack create conntrack which has following tuples.
| Src |Dst
-------------------------------------------
| Address | Port |Address | Port
-------------------------------------------
Original | A4 | a |B4 | b
Reply | B4 | b |A4 | a
NA(P)T-PT module will select unique tuple, and change tuple of conntrack.
| Src |Dst
-------------------------------------------
| Address | Port |Address | Port
-------------------------------------------
Original | A4 | a |B4 | b
Reply | B'6 | b |A'6 | a'
# A4, B4 : IPv4 addr
# A'6, B'6 : IPv6 addr
nf_conntrack doesn't need to care about weather tuple has changed or not. It just find conntrack which has tuple matched with IPv{4,6} header of packet, and update states of it.
Handling tuple and conntrack in NA(P)T-PT are same as IPv4 NAT.
The differences are creating IPv{4,6} header and passing to other network stack. And please care about relation of IPv4 NAT and NA(P)T-PT. These are exclusive.
Quoted 11 lines
Quoted 4 lines
You need to write NA(P)T-PT code based on
nf_conntrack. Maybe IPv4 NAT codes help you. The biggest issue is how pass packets from IPv4 stack to IPv6 stack and vice versa. I imagine that addresses in packets are mangled at only NF_IP{6}_PRE_ROUNTING, and then callednetif_rx().That was my first idea. But I've seen some code that makes use
ip_route_me_harder()+ip_output()for injecting IPv4 packets, andip6_route_me_harder()+ip6_outputfor IPv6 packets.
I fear that withnetif_rx()traslated packet would be tracked again, and this is not what I need. (I'm sorry but I'm still studying netfilter and conntrack (and English too ;) ) so it's likely that I'm wrong).
Sorry, I'm confusing. Which path should packets go through ? we need to design so that users can filter/log packets before and/or after translating. At least, translated packets should go through NF_IP{6}_FORWARD, I think.
Quoted 4 lines
Quoted 2 lines
BTW, if allowed, could you Cc to netfilter-devel for other folks who interested in this area ?
I've just done it ;)
Thanks!
-----------------------------------------------------------------
Yasuyuki KOZAKAI @ USAGI Project <[email protected]>
Quoted 3 lines · Yasuyuki Kozakai
nf_conntrackdoesn't need to care about weather tuple has changed or not. It just find conntrack which has tuple matched with IPv{4,6} header of packet, and update states of it.
But conntrack do care about the protocol and is only implemented for IPv4.
Assuming there is a 1-1 map IPv4<->IPv6 (after any IPv4 NAT applied by iptables) then the translation is probably best implemented as a virtual tunnel like device outside of netfilter. IPv4 packets routed to this tunnel gets translated into IPv6 and then reinjected to the other stack as input packets and vise versa. Beware of loops.
In early implementation you can use the TUN device and run the translation in userspace. In final implemenenation you want to implement a new virtual device running the translation in kernel land to avoid extra copying of the packet data and context switches..
Regards
Henrik
Hi Yasuyuki,
Quoted 12 lines · you
Quoted 11 lines
Quoted 4 lines
You need to write NA(P)T-PT code based on
nf_conntrack. Maybe IPv4 NAT codes help you. The biggest issue is how pass packets from IPv4 stack to IPv6 stack and vice versa. I imagine that addresses in packets are mangled at only NF_IP{6}_PRE_ROUNTING, and then callednetif_rx().That was my first idea. But I've seen some code that makes use
ip_route_me_harder()+ip_output()for injecting IPv4 packets, andip6_route_me_harder()+ip6_outputfor IPv6 packets.
I fear that withnetif_rx()traslated packet would be tracked again, and this is not what I need. (I'm sorry but I'm still studying netfilter and conntrack (and English too ;) ) so it's likely that I'm wrong).
Quoted 4 lines
Sorry, I'm confusing. Which path should packets go through ? we need to design so that users can filter/log packets before and/or after translating. At least, translated packets should go through NF_IP{6}_FORWARD, I think.
I agree with you, users should be able to filter/log NAT(P)T-PT'ed packets. However there are some (bad) problems.
At present time your conntrack code doesn't handle IPv6 fragments, but I guess that when it will do, IPv6 datagrams will be defragmented as in current conntrack. So I assume that NA(P)T-PT code will see only entire l3 packets.
One problem is that I should know if original datagrams had a fragment header or not. NA(P)T-PT should produce IPv4 packets with DF flag set for IPv6 non-fragment datagrams and IPv4 packets with DF not set for IPv6 datagrams with a fragment header. So, although on one hand I need conntrack, on the other hand I should see original datagrams.
A similar problem turns out on IPv4-to-IPv6 translation. When I receive IPv4 datagrams with DF not set, I should fragment them so that their IPv6 translation fits in 1280 octects. If DF flag is set, in order to allow pathMTU discovery, I should preserve their size and I should translate them into IPv6 datagram without a fragmentation header (except for IPv4 fragments with DF set...).
I'm trying to say (with my terrible English) that a NA(P)T-PT implementation should have more control over IPv6/IPv4 packets: since conntrack defragments/fragments them it's impossible to be RFC 2766 compliant.
For these reasons I'm tempted to use the approach proposed by Henrik (virtual network device).
Please correct me if I've made any mistakes.
BTW: I'm very happy that your conntrack will be put into patch-o-matic-ng ;)
Best regards,
Davide
Signature · 1 line
T@1t
Hi, Davide,
Sorry for late replying.
From: Davide <[email protected]>
Date: Thu, 26 Feb 2004 13:20:08 +0100
Quoted 10 lines
Quoted 4 lines
Sorry, I'm confusing. Which path should packets go through ? we need to design so that users can filter/log packets before and/or after translating. At least, translated packets should go through NF_IP{6}_FORWARD, I think.
I agree with you, users should be able to filter/log NAT(P)T-PT'ed packets. However there are some (bad) problems.
At present time your conntrack code doesn't handle IPv6 fragments, but I guess that when it will do, IPv6 datagrams will be defragmented as in current conntrack. So I assume that NA(P)T-PT code will see only entire l3 packets.
Yes. That is missing piece. Of cause, I'll implement that. But I haven't decide how to handle fragmented IPv6 packets yet.
ip6_conntrack, which is written by me and tracks only IPv6 packets, clone fragmented packets and reassemble them (note: not linearize). After tracking, reassembled packet is discard and pass original fragmented packets to next network process. Of cause, original fragmented skbs points to same conntrack.
I adopted this way to prevent from disturbing other IPv6 codes(ex. Path MTU Discovery.)
But I don't know this is best. Maybe NA(P)T-PT helper module wants reassembled packet to rewrite data in payload (ex FTP).
Quoted 6 lines
One problem is that I should know if original datagrams had a fragment header or not. NA(P)T-PT should produce IPv4 packets with DF flag set for IPv6 non-fragment datagrams and IPv4 packets with DF not set for IPv6 datagrams with a fragment header. So, although on one hand I need conntrack, on the other hand I should see original datagrams.
A similar problem turns out on IPv4-to-IPv6 translation. When I receive IPv4
Quoted 8 lines
datagrams with DF not set, I should fragment them so that their IPv6 translation fits in 1280 octects. If DF flag is set, in order to allow pathMTU discovery, I should preserve their size and I should translate them into IPv6 datagram without a fragmentation header (except for IPv4 fragments with DF set...).
I'm trying to say (with my terrible English) that a NA(P)T-PT implementation should have more control over IPv6/IPv4 packets: since conntrack defragments/fragments them it's impossible to be RFC 2766 compliant.
IPv4 header has DF bit field and it's not changed. so there is no problem even if reassembled by conntrack in the case of IPv4-to-IPv6.
There is problem in the case of IPv6-to-IPv4. I was going to implement so that nf_conntrack removes Fragment Header in the case that payload length of reassembled packet is > 65535 - 8 .
ok, I need to be more care about handling fragmented packet.
But in any case, original(not reassembled) IPv6 packets are needed to be passed next network.
And I think it's natural that behavior for IPv4 and IPv6 is synchronized. This mean that IPv4 packets isn't reassembled.
In this case, benefits are
- all modules can process fragmented packets with any style.
- all modules can prevent from disturbing other network code.
drawbacks are
- User Interface will be changed. current ip_conntrack reassemble at PRE_ROUTING, and refragment at POST_ROUTING. so users assume that packets are reassembled when filtering.
- if multiple module want reassembled packets, reassembling is occurred many times.
The 1st drawback can be solved at ip{6}_tables in kernel. But I don't any idea about 2nd issue in now.
Quoted 2 lines
For these reasons I'm tempted to use the approach proposed by Henrik (virtual network device).
I have timely news. Recently, I heard that kernel implementation of NAT-PT is already created. Maybe this implementation doesn't use netfilter. virtual device ???
I'll attach the message at usagi-users ML.
Received: from mx2.toshiba.co.jp (mx2.toshiba.co.jp [133.199.160.163])
by isl.rdc.toshiba.co.jp (8.11.7/8.11.6/1.4) with ESMTP id i1REpf128100; Fri, 27 Feb 2004 23:51:41 +0900 (JST) Received: from tsb-sgw2.toshiba.co.jp by toshiba.co.jp id XAA17776; Fri, 27 Feb 2004 23:51:41 +0900 (JST) Received: from inet-tsb5.toshiba.co.jp by tsb-sgw2.toshiba.co.jp with ESMTP id i1REpe8U014622; Fri, 27 Feb 2004 23:51:40 +0900 (JST) Received: from linux6.nezu.wide.ad.jp (linux6.nezu.wide.ad.jp [203.178.142.218]) by inet-tsb5.toshiba.co.jp with ESMTP id i1REpd4v018298 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 27 Feb 2004 23:51:39 +0900 (JST) Received: from nezu.linux-ipv6.org (localhost [127.0.0.1]) by linux6.nezu.wide.ad.jp (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1REEPAA016856; Fri, 27 Feb 2004 23:14:25 +0900 Received: from web40301.mail.yahoo.com (web40301.mail.yahoo.com [66.218.78.80]) by linux6.nezu.wide.ad.jp (8.12.3/8.12.3/Debian-6.6) with SMTP id i1REEFAA016836 for <[email protected]>; Fri, 27 Feb 2004 23:14:15 +0900
Received: from [193.220.224.6] by web40301.mail.yahoo.com via HTTP; Fri, 27 Feb 2004 04:27:28 PST
Date: Fri, 27 Feb 2004 04:27:28 -0800 (PST)
From: sunil arora <[email protected]>
Reply-To: [email protected]
Subject: (usagi-users 02823) regarding NAT-PT implementation in linux kernel
To: [email protected], [email protected]
Cc: [email protected]
Message-Id: <[email protected]>
X-ML-Name: usagi-users
X-Mail-Count: 02823
X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post)
X-ML-Info: If you have a question, send e-mail with the body
"help" (without quotes) to the address [email protected]; help=<mailto:[email protected]?body=help>
X-Spam-Status: No, hits=0.0 required=5.0 tests= version=2.20
X-Spam-Flag: No
X-Spam-Probability: 0.499972
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Precedence: bulk
Lines: 29
List-Id: usagi-users.linux-ipv6.org
List-Software: fml [fml 4.0.3 release (20011202/4.0.3)]
List-Post: <mailto:[email protected]>
List-Owner: <mailto:[email protected]>
List-Help: <mailto:[email protected]?body=help>
List-Unsubscribe: <mailto:[email protected]?body=unsubscribe>
X-UIDL: -DF"!+7-"!</7!!<<d!!
Hi all,
I am really sorry for late response. Actually was busy with mid-semester exms here!
Our Nat-PT implementation in linux kernel is almost over and we are giving it final testing. It will take roughly 25 days to get the finally tested patch available for kernel 2.4.22.
I hope you guys can bear with us. And We will be releasing a floppy based version of our distribution as well, that is also almost ready.
I apologise for not making the code available right away.
There is also a userland application developed by some instituition in Korea which performs NAT-PT. I read an article in LJ discussing a NAT-PT set up ..some months back.I will send the pointer to their link in the next mail.
-sun
__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools
Hi Yasuyuki,
Quoted 3 lines · you
Hi, Davide,
Sorry for late replying.
Don't worry, thank you very much for your reply ;)
Quoted 21 lines
Quoted 11 lines
Quoted 4 lines
Sorry, I'm confusing. Which path should packets go through ? we need to design so that users can filter/log packets before and/or after translating. At least, translated packets should go through NF_IP{6}_FORWARD, I think.
I agree with you, users should be able to filter/log NAT(P)T-PT'ed packets. However there are some (bad) problems.
At present time your conntrack code doesn't handle IPv6 fragments, but I guess that when it will do, IPv6 datagrams will be defragmented as in current conntrack. So I assume that NA(P)T-PT code will see only entire l3 packets.Yes. That is missing piece. Of cause, I'll implement that. But I haven't decide how to handle fragmented IPv6 packets yet.
ip6_conntrack, which is written by me and tracks only IPv6 packets, clone fragmented packets and reassemble them (note: not linearize). After tracking, reassembled packet is discard and pass original fragmented packets to next network process. Of cause, original fragmented skbs points to same conntrack.
Quoted 5 lines
I adopted this way to prevent from disturbing other IPv6 codes(ex. Path MTU Discovery.)
But I don't know this is best. Maybe NA(P)T-PT helper module wants reassembled packet to rewrite data in payload (ex FTP).
Yes, that is a good way, but there is another issue. Since conntrack will be used to implement a statefull IPv6 filtering, we need to be sure that what is received by destination host is what the firewall have seen.
I know that partially overlapped IPv6 fragments should never appear (since only the source host can perform fragmentation), but in general we don't know if the destination host will accept or discard them.
If the firewall lets them pass, we couldn't be sure of the order in which they will be received by the destination ( think, for instance, to the well-known IPv4 overlapped fragments attack).
Personally I think that a firewall must discard overlapped (IPv4/IPv6) fragments, but this is only my personal point of view.
Quoted 16 lines
Quoted 7 lines
One problem is that I should know if original datagrams had a fragment header or not. NA(P)T-PT should produce IPv4 packets with DF flag set for IPv6 non-fragment datagrams and IPv4 packets with DF not set for IPv6 datagrams with a fragment header. So, although on one hand I need conntrack, on the other hand I should see original datagrams. A similar problem turns out on IPv4-to-IPv6 translation. When I receive IPv4 datagrams with DF not set, I should fragment them so that their IPv6
Quoted 8 lines
translation fits in 1280 octects. If DF flag is set, in order to allow pathMTU discovery, I should preserve their size and I should translate them into IPv6 datagram without a fragmentation header (except for IPv4 fragments with DF set...).
I'm trying to say (with my terrible English) that a NA(P)T-PT implementation should have more control over IPv6/IPv4 packets: since conntrack defragments/fragments them it's impossible to be RFC 2766 compliant.
Quoted 2 lines
IPv4 header has DF bit field and it's not changed. so there is no problem even if reassembled by conntrack in the case of IPv4-to-IPv6.
Actually ip_conntrack ignore DF flag in fragmented IPv4 fragments. This leads to a problem described in this bug report:
https://bugzilla.netfilter.org/cgi-bin/bugzilla/show_bug.cgi?id=48
In this report I've proposed a solution; however I must admit that the implementation I've proposed it is not good. (However I don't know if that idea can be useful for you).
I think we must avoid that problem in IPv6 connection tracking since in this case the consequences are more serious.
Quoted 5 lines
There is problem in the case of IPv6-to-IPv4. I was going to implement so that
nf_conntrackremoves Fragment Header in the case that payload length of reassembled packet is > 65535 - 8 .ok, I need to be more care about handling fragmented packet.
If there were no problems it wouldn't be amusing! ;))
Quoted 14 lines
But in any case, original(not reassembled) IPv6 packets are needed to be passed next network.
And I think it's natural that behavior for IPv4 and IPv6 is synchronized. This mean that IPv4 packets isn't reassembled.In this case, benefits are
- all modules can process fragmented packets with any style.
- all modules can prevent from disturbing other network code.drawbacks are
- User Interface will be changed. currentip_conntrackreassemble atPRE_ROUTING, and refragment atPOST_ROUTING. so users assume that packets are reassembled when filtering.
Quoted 5 lines
- if multiple module want reassembled packets, reassembling is occurred many times.
The 1st drawback can be solved at ip{6}_tables in kernel. But I don't any idea about 2nd issue in now.
I agree with you, IPv6 and IPv4 conntrack behaviours should be synchronized. This is an hard issue: any solutions will require many changes in present netfilter modules...
Quoted 8 lines
Quoted 2 lines
For these reasons I'm tempted to use the approach proposed by Henrik (virtual network device).
I have timely news. Recently, I heard that kernel implementation of NAT-PT is already created. Maybe this implementation doesn't use netfilter. virtual device ???
I'll attach the message at usagi-users ML.
Thank you very much. I've also noticed another NA(P)T-PT implementation in the Linux kernel (http://naptpt.sourceforge.net/). However this implementation doesn't handle fragment (both for IPv4 and IPv6), and use a poor connection tracking for TCP based on activity instead of the state: it removes a TCP connection from tracked connections if there is no activity for a certain period of time (this is good for UDP and ICMP but not for TCP). Moreover this implementation bypasses all netfilter code (it intercepts packets in PRE_ROUTING and uses ip_output() to send translated packets).
I'm really in trouble: I have got the code for the tranlation, I have got a precise idea of how to translate packets (even in case of fragmentation) but I can't decide where to translate... ;))
Best regards,
Davide Guerri.
Signature · 1 line
T@1t
Quoted 25 lines · you
Hi,
From: Davide Guerri <[email protected]>
Date: Fri, 20 Feb 2004 09:42:13 +0100Quoted 1 line
Hi, and sorry for my poor English.
Don't worry. me too.
Quoted 3 lines
I'm very interested in this project since I'm writing a NA(P)T-PT (as described in RFC 2766) implementation for Linux. Actually I'm a student (computer science, in Rome) and this will be my PhD thesis.
Great.
Quoted 2 lines
What happened to your code? I've downloaded USAGI Linux kernel, but I've found only your previous IPv6 conntrack. (very good work however!)
nf_conntrackis not in USAGI linux26. Of cause, I'll commit it to USAGI tree.After I sent
nf_conntrack, Mr. Harald Welte, who is a member of Netfilter Core Team, suggested that L3 part of conntrack (tuple, too) should be allocated dynamically.
Quoted 6 lines
Then I wrote "dynamic version" and sent it last year (December), but I suspend this work due to other work for a while. Fortunately, I could resume to this work. I'll evaluate 2 implementations, and decide which implementation is adopted.
After that, I'll commit
nf_conntrackto USAGI tree.
That's a great news.
I've tryed the second version of your nf_conntrack. It seems to work very well!
Quoted 10 lines
Quoted 4 lines
Is there some documentation on conntrack? I'm reading the existing NAT code, but it's quite difficult to understand. It's difficult for me because I don't yet completely understand the general behaviour of netfilter conntrack and the role of its tricky data structures.
Unfortunately, there isn't documentation about
nf_conntrack. But its scheme is mostly same asip_conntrack. The differences are tuple, new functions and arguments for Layer 3 header handling, and new module for Layer 3 protocols.
Quoted 5 lines
BTW, do you read Documentations at Netfilter Project web page ?
http://www.netfilter.org/documentation/index.html
"Netfilter Hacking HOWTO" may help you.
In the (very good) "Netfilter Hacking HOWTO" there are some infos on NAT, but I would need more detail.
However there is no problem, I'll study the netfilter code. ;)
Quoted 7 lines
Quoted 4 lines
I've also downloaded the
nf_conntrackpatch included in your post on netfilter-devel, I've applied it to a vanilla 2.6.0 Kernel and I'm going to try it. Prior to read that code, I would ask you if it can handle mixed IPv6-IPv4 tuples.Thank you for using
nf_conntrack. But you cannot handle mixed tuples (ex. src = IPv6, dst = IPv4) in now.
Sorry, I've expressed myself badly! What I need is to change the expected reply of the conntrack from an IPv4 tuple to an IPv6 tuple and vice versa. Hence what I would to know is if nf_conntrack can handles original-direction tuples of one type and reply-direction tuple of the other type (so that it will be possible to track a "NA(P)T-PT'ed connection").
Quoted 4 lines
You need to write NA(P)T-PT code based on
nf_conntrack. Maybe IPv4 NAT codes help you. The biggest issue is how pass packets from IPv4 stack to IPv6 stack and vice versa. I imagine that addresses in packets are mangled at only NF_IP{6}_PRE_ROUNTING, and then callednetif_rx().
That was my first idea. But I've seen some code that makes use ip_route_me_harder() + ip_output() for injecting IPv4 packets, and ip6_route_me_harder() + ip6_output for IPv6 packets.
I fear that with netif_rx() traslated packet would be tracked again, and this is not what I need. (I'm sorry but I'm still studying netfilter and conntrack (and English too ;) ) so it's likely that I'm wrong).
Quoted 2 lines
BTW, if allowed, could you Cc to netfilter-devel for other folks who interested in this area ?
I've just done it ;)
Quoted 4 lines
Regards,
-----------------------------------------------------------------
Yasuyuki KOZAKAI @ USAGI Project <[email protected]>
Thank you very much Yasuyuki for your work and for your quick reply!
Best regards,
Davide Guerri.
Signature · 1 line
T@1t