tun device

From: Benjamin Menküc (benjamin_at_menkuec.de)
Date: 12/30/04


Date: Thu, 30 Dec 2004 03:54:49 +0100

Hi,

I created a tunnel device using the kernel supported function tun_open.
Then I assigned an ip address to tun0 using ifconfig tun0 192.168.0.10.

I want to read now the plain ip packets, but how can I do this?
In my test program I have

while(1)
{
    readn_t(fd_tun,buf,100,timeout); //read with timeout
printf("tun:%s\n",buf);
}

I never receive any data from the tun device.

Do I have to listen on the fd socket for incoming connects? Or How can I set
the tun device to accept every connect request?

when I do ssh 192.168.0.10 it says connection refused (Port 22).

regards,
Benjamin