Skip to contentSkip to conversation

NAT for IPv6 FINISHED!!!!!

DISCUSSION Natty McButterpants 3 participants 4 messages May 24, 2004 – May 27, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

Gentlemen,
We have finished the NAT development for IPv6. It properly translates ICMPv6, UDP, and TCP packets. We still need to clean up the code, perform a few more tests and what not. We used ping6, traceroute6, and rlogin along with Ethereal and staring at a lot of tcpdump hex output in order to test the NAT. We have not yet ported over support for application level stuff like TFTP, FTP, etc, but it does not appear to be too difficult and we may get that out at some point. Additionally, we need to compile in DNAT support into the ip6tables user-space tool, as right now SNAT is all that is compiled in. The code is rough, but it works, and as soon as we get it annotated and cleaned up into a tarball, we'll send it out to whomever wants it.

In response to Jozsef Kadlecsik's question:

Quoted 5 lines

I hope this work is based on Yasuyuki Kozakai's nf_conntrack
generalization...

Best regards,
Jozsef

Yes, we used USAGI's 2.6.5 kernel with their included connection tracking suite to develop and test our NAT. We only had to make a few minor modifications.

---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

#1 lore raw

From: Natty McButterpants <[email protected]>
Date: Mon, 24 May 2004 14:19:02 -0700 (PDT)

Quoted 2 lines

Gentlemen,
We have finished the NAT development for IPv6. It properly translates ICMPv6, UDP, and TCP packets. We still need to clean up the code, perform a few more tests and what not. We used ping6, traceroute6, and rlogin along with Ethereal and staring at a lot of tcpdump hex output in order to test the NAT. We have not yet ported over support for application level stuff like TFTP, FTP, etc, but it does not appear to be too difficult and we may get that out at some point. Additionally, we need to compile in DNAT support into the ip6tables user-space tool, as right now SNAT is all that is compiled in. The code is rough, but it works, and as soon as we get it annotated and cleaned up into a tarball, we'll send it out to whomever wants it.

I think your work is useful when someone writes NAT-PT with conntrack because we can see how generalization is needed.

Quoted 8 lines

In response to Jozsef Kadlecsik's question:

Quoted 5 lines

I hope this work is based on Yasuyuki Kozakai's nf_conntrack
generalization...

Best regards,
Jozsef

Yes, we used USAGI's 2.6.5 kernel with their included connection tracking suite to develop and test our NAT. We only had to make a few minor modifications.

I revised nf_conntrack to able to handle fragmented IPv6 packets and I'm debugging now. After committing and more testing it, I'll delete ip6_conntrack from USAGI tree.

P.S. By the way, what situation do you want to use NAT with IPv6 ?

Regards,

-----------------------------------------------------------------
Yasuyuki KOZAKAI @ USAGI Project <[email protected]>

#2 lore raw

Hi Yasuyuki,
how do you handle ipv6 fragment? It is possible to know original fragments size?

BTW, some time ago I have finished my first version of NA(P)T-PT but I wrote my own connection tracking code (I had expires and I could not wait for an IPv6 conntrack that could handle fragmentation).

However my connection tracking code isn't that different from yours so, with minimal effort, I can remove it and use your code when (and if) it will meet my requirements.

My NA(P)T-PT supports fragmentation (on IPv4 and IPv6 side), preserves the DF(IPv4) and Fragment Header(IPv6) semantics (it is possible to do path MTU discovery throught it and it can handle correctly fragments with DF flag set) and, for now, it works like the masquerade: it's unidiretional, in the sense that connections may start only from IPv6 side, and IPv4 source address (for IPv6 to IPv4 translations) is calculated dinamically. Unfortunately to handle correctly fragments I have had to re-write parts of kernel fragmentation/defragmentation code, so I'm not that proud of my code ;)

Best regards,
Davide Guerri.

----- Original Message -----
From: "Yasuyuki Kozakai" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, May 26, 2004 4:01 PM
Subject: Re: NAT for IPv6 FINISHED!!!!!

Quoted 9 lines

[...]
I think your work is useful when someone writes NAT-PT with conntrack because we can see how generalization is needed.
[...]
I revised nf_conntrack to able to handle fragmented IPv6 packets and I'm debugging now. After committing and more testing it, I'll delete ip6_conntrack from USAGI tree.
[...]
P.S. By the way, what situation do you want to use NAT with IPv6 ?

#3 lore raw

handling fragments in nf_conntrack(was Re: NAT for IPv6 FINISHED!!!!!)

Hi,

From: "Davide Guerri" <[email protected]>
Subject: Re: NAT for IPv6 FINISHED!!!!!
Date: Wed, 26 May 2004 18:25:05 +0200

Quoted 3 lines

Hi Yasuyuki,
how do you handle ipv6 fragment? It is possible to know original fragments size?

nf_conntrack pass the original fragmented packets to next network processing.

These packets are binded with the conntrack which tuple is consisted with IPv6 addresses and ID in Fragmented Header. This conntrack has the reference to the reassembled packet. And it is binded with other conntrack dependent on upper protocol. for example,

	fragments -> conntrack (protocol=frag6) -> reassembled packet

	-> conntrack (protocol=udp)

Then you can access to the reassembled packet from original packets. But, of cause, if you mangle original packets, reassembled packet must be mangled too.

IPv4 fragmented packets are handled in the same way as ip_conntrack. (pass reassembled packet to next processing)

Regards,

Quoted 18 lines

BTW, some time ago I have finished my first version of NA(P)T-PT but I wrote my own connection tracking code (I had expires and I could not wait for an IPv6 conntrack that could handle fragmentation).

However my connection tracking code isn't that different from yours so, with minimal effort, I can remove it and use your code when (and if) it will meet my requirements.

My NA(P)T-PT supports fragmentation (on IPv4 and IPv6 side), preserves the DF(IPv4) and Fragment Header(IPv6) semantics (it is possible to do path MTU discovery throught it and it can handle correctly fragments with DF flag set) and, for now, it works like the masquerade: it's unidiretional, in the sense that connections may start only from IPv6 side, and IPv4 source address (for IPv6 to IPv4 translations) is calculated dinamically. Unfortunately to handle correctly fragments I have had to re-write parts of kernel fragmentation/defragmentation code, so I'm not that proud of my code ;)

Quoted 2 lines

Best regards,
Davide Guerri.

-----------------------------------------------------------------
Yasuyuki KOZAKAI @ USAGI Project <[email protected]>