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


  Search this Thread
Old 05-19-2009, 06:22 AM   #1
LQ Newbie
Registered: Feb 2009
Posts: 11

Rep: Reputation: 0
Forwarding the IP frame from tun0 to eth0

Hi all,
I am working on TUN/TAP for tunnelling IP packets from the application to the network.

I am able to open the tun device and assign the IP address to tun0. The steps I followed are given,

1. Opened the tun device /dev/net/tun
2. Assigned a IP address to the tun0 using ifconfig tun0
3. Added to the routing table using the following command route add -host dev tun0
4. I have loaded the tun device using modprobe tun and I was able to see the device when I gave the command lsmod | sort
         tsdev                   7520  0 
         tun                    10336  1
5. the output of the command route is

Code:    *     UH    0      0        0 tun0    *     U     0      0        0 eth0
default         UG    0      0        0 eth0
6. I have installed uml-utilities & bridge utilities.
7. finally I wrote a IP frame to tun0 device . The IP packet was for opening a ftp session on other machine (

I could seee the packet received in tun0 device using ifconfig and wireshark.

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:  P-t-P:  Mask:
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:60 (60.0 b)  TX bytes:0 (0.0 b)
The IP Packet which I sent is received in the tun0 device, but furhter its not routing it to the eth0 device.

My question is, how do I route the IP packets recevied in tun0 device to the network via eth0 and vice versa.

Is there any package or driver i need to install inorder to configure the tun device for routing it to the eth0

Thanks you in Advance
Alan J

Last edited by johnniealan; 05-19-2009 at 06:29 AM.
Old 09-29-2009, 09:10 PM   #2
LQ Newbie
Registered: Sep 2009
Location: San Francisco
Posts: 1

Rep: Reputation: 0

Ever figure this one out?


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selective ethernet frame forwarding via userspace / kernel space program neur0tic Linux - Networking 5 12-24-2007 04:52 PM
Packet Forwarding from eth0 to eth1 isn't working rajat Linux - Networking 1 05-07-2007 05:24 AM
port forwarding from eth0 to eth1 ? overproof Linux - Networking 7 05-16-2005 03:48 AM
IP forwarding from eth0 to eth1 musicman_ace Linux - Networking 5 08-01-2004 05:39 AM
eth0 interface stops forwarding geustace Linux - Networking 4 03-09-2004 02:28 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:00 PM.

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