Review your favorite Linux distribution.
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 01-21-2007, 12:27 PM   #1
LQ Newbie
Registered: Jun 2006
Posts: 3

Rep: Reputation: 0
tun tap query

i have one doubt
i configured the tun0 interface after the open systemcall

the interface is up and running
next i configured it using the following:

"ifconfig %s pointopoint mtu 1500"

next i created a simple udp server which sends a message like"hello" to the tun0 interface

In my tunnel code,if i want to read from the /dev/net/tun interface, if i use the following code

len=read(tuntapfd,temp_buffer,sizeof(temp_buffer));//hangs here
printf("\n recieved.........\n");
printf("failed ........");

i know that i shud be using select for reading and shud be non blocking,but i just wantd to test it with a simple read statement

the problem is that the program hangs???????
the data it seems has not been transferred to the /dev/net/tun character device file

please help me out on this
what my doubt exactly is that if i send data say"hello" on the tun0 interface ,will my code be able to use it or access it using the /dev/net/tun character file because this is what i have been trying with no success

how should i proceed with this?

Old 03-26-2007, 11:29 AM   #2
LQ Newbie
Registered: Mar 2007
Posts: 2

Rep: Reputation: 0
i hav a similar problem ..... did you manage to solve it


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
tun tap doubt karan84 Linux - Networking 2 01-10-2007 01:43 AM
Tun/Tap issue minasafwat Linux - Kernel 0 11-14-2006 01:11 AM
Tun/Tap getting started? blavo Linux - Newbie 0 02-14-2006 10:29 AM
how to allow tun/tap device in firewall? efm Linux - Networking 12 07-22-2005 04:47 AM
TUN TAP for non-Redhat Machine Echo Kilo Linux - Networking 3 12-19-2004 06:16 PM

All times are GMT -5. The time now is 04:35 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