The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how can I find which one is eth0? samnyc UNIX for Dummies Questions & Answers 2 03-06-2009 07:08 PM
ssh X-forwarding and remote forwarding behind proxy vampirodolce Security 1 10-29-2008 04:25 AM
Iptables/TC: how to make masqueraded traffic go through an openVPN tun0? theVOID IP Networking 2 08-28-2008 12:46 AM
Adding an IP to eth0 D-Lexy IP Networking 1 12-30-2003 06:15 PM
ins mod error on eth0 alam UNIX for Dummies Questions & Answers 1 09-17-2001 03:07 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-19-2009
johnniealan johnniealan is offline
Registered User
  
 

Join Date: May 2009
Posts: 3
Forwarding the IP packet from tun0 to/from 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 10.66.67.247
3. Added to the routing table using the following command route add -host 10.66.67.247 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
Code:
         tsdev                   7520  0 
         tun                    10336  1
5. the output of the command route is
Code:
10.66.67.247    *   255.255.255.255     UH    0      0        0 tun0
10.66.67.192    *   255.255.255.192     U     0      0        0 eth0
default 10.66.67.193    0.0.0.0         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 (10.66.67.220.

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

Code:
tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.66.67.247  P-t-P:10.66.67.247  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          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 been routed 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 for your inputs in Advance
Johnnie Alan J
  #2 (permalink)  
Old 06-04-2009
Lazydog's Avatar
Lazydog Lazydog is offline
Registered User
  
 

Join Date: Oct 2008
Location: Chester Co., PA
Posts: 73
Turn on FORWARDing.
  #3 (permalink)  
Old 06-05-2009
johnniealan johnniealan is offline
Registered User
  
 

Join Date: May 2009
Posts: 3
hi,

Thanks for your inputs.

But may i know which forwarding your are talking about. do you mean /proc/sys/net/ipv4/ip_forward? .

I have enabled in the file mentioned above


regards
johnnie alan j
  #4 (permalink)  
Old 06-10-2009
stdout stdout is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 103
hi johnie,

i'm a bit unclear here,
can you draw us a small picture what are you trying to accomplish?
  #5 (permalink)  
Old 06-11-2009
johnniealan johnniealan is offline
Registered User
  
 

Join Date: May 2009
Posts: 3
hi all,

I am sending an IP packet to another machine on the same LAN using tun0 device. The Packet is traversed through PREROUTING and doesnt go the FORWARD chain.

tun0 (10.66.67.247) <-------> eth0 (10.66.67.208)<----> machine2 ( 10.66.67.220)

I am send an IP packet to 220 machine.

Tun0 is up and running.

Thanks in advance
Alan J
  #6 (permalink)  
Old 07-10-2009
Lazydog's Avatar
Lazydog Lazydog is offline
Registered User
  
 

Join Date: Oct 2008
Location: Chester Co., PA
Posts: 73
[quote=johnniealan;302324481
tun0 (10.66.67.247) <-------> eth0 (10.66.67.208)<----> machine2 ( 10.66.67.220)[/quote]

Are both of these ip address on the same machine? I don't see any eth# on the side for machine 2.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 09:24 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0