LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-16-2010, 03:54 AM   #1
the_ionic
LQ Newbie
 
Registered: Oct 2009
Posts: 5

Rep: Reputation: 0
Tun/Tap driver - IPv4 in IPv6


My problem is the following:
I want to use tun driver for implementing an IPv4-in-IPv6 tunneling mechanism. I know that IP4-in-IP6 tunnel are available in Linux but I have specific needs which lead me to use tun driver.
I have a 2 machines, a client and a server, each one having an IPv4 address. My goal is to encapsulate IPv4 packets from client to server in IPv6 tunnel. For that, I use an userspace program conjointly with tun driver. This program create one tunnel for encaspulating(tun46) and one tunnel for decapsulating (tun64) on both client and server. Encapsulation and decapsulation functions are written by myself.
So by using tun driver, I succeed to intercept IPv4 packets (in that case a ping from client to server) from client in userspace (in fact a default route indicate that all IPv4 packet should go to tun46), to encapsulate it thanks to C code that I wrote, and to send it to the server by the tunnel.
The server receives the encapsulated packet but the problem begins. If I put the destination IPv6 address of the encapsulated packet on the interface which receives the packet on server side, the server replies immediately with ICMPv6 parameter problem because it doesn't know how to handle the IPv4-in-IPv6 packet. If I dont put any IPv6 address, the packet is correctly routed to tun64, and decapsulated without any problem but the decapsulated packet (so the IPv4 ping) is delivered through the tunnel tun64 and never routed through the server interface which has the IPv4 destination address. I try to change route but it never works.
Do you have any ideas?

Regards
 
Old 04-17-2010, 03:13 AM   #2
TimothyEBaldwin
Member
 
Registered: Mar 2009
Posts: 249

Rep: Reputation: 27
You seem to be expecting that when a computer receives a packet addressed to itself it sends it elsewhere.
 
Old 04-17-2010, 09:45 AM   #3
the_ionic
LQ Newbie
 
Registered: Oct 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TimothyEBaldwin View Post
You seem to be expecting that when a computer receives a packet addressed to itself it sends it elsewhere.
Not really but I understand what you mean. What I need is an encapsulation/decapsulation IPv4-in-IPv6 solution but with specific needs. After browsing a while on the Internet, I'm sure that tun/tap driver allows me to do that.
Maybe I misunderstand tun/tap and tunnels in general but what I'm trying to do is simply to establish tunnel between 2 hosts.
So it's normal that when the ICMPv4 packet encaspulated in IPv6 from the client to the server goes through the server decap interface (tun64), I expect that tun64 decapsulates IPv6 header (and it works ), and also that tun64 delivers the packet to the server's real interface in IPv4. It's the normal role of a tunnel and that what I'm trying to do, not to deliver a packet addressed to a host to another.
 
Old 04-17-2010, 07:48 PM   #4
TimothyEBaldwin
Member
 
Registered: Mar 2009
Posts: 249

Rep: Reputation: 27
Quote:
Originally Posted by the_ionic View Post
and also that tun64 delivers the packet to the server's real interface in IPv4. It's the normal role of a tunnel
You said the packet was addressed to the server, which is doing the de-encapsulation, in which case it would be completely broken to send the packet to another interface as it should be locally processed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPv6 over IPv4 tunneling driver LaoLiulaoliu Debian 1 05-04-2007 08:57 AM
"getting" the TAP/TUN Device Driver.. A64 architecture jpena Linux - Networking 0 02-23-2007 12:36 AM
Unable to install a Tun/Tap driver on a 2.6.18 kernel Slackware 11 Exterminator34 Slackware 4 12-01-2006 02:40 PM
bootup freezes for 10 minutes at: IPv6 over IPv4 tunneling driver jariep Debian 1 01-03-2005 05:27 AM
Universal tun/tap device driver support giddyupman Linux - Networking 4 05-14-2004 10:04 AM


All times are GMT -5. The time now is 03:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration