[Novalug] linux tunneling question: vtun

Megan Larko larkoc@iges.org
Tue Jul 28 16:31:01 EDT 2009


Hello List!

I have a server at the office to which I would like to be able to tunnel via ssh  from outside of 
the office environment.

Server: salad
eth0: 192.239.A.B
CentOS 5.1   kernel 2.6.18-8.1.10.el5  in which CONFIG_TUN=m
vtund-3.0.1

Client: LinuxMint (live USB)
eth0: DHCPs
LinuxMint 7 Gloria  2.6.28-11-generic in which CONFIG_TUN=m
vtund 3.x.02

I have a a configuration file for the server and the client.  I have the device /dev/net/tun on both 
systems with the same major (10) and minor (200) numbers.   I run "modprobe tun" to get the tun 
driver loaded which it does without errors.

After starting vtund -s -f /path/to/vtund.server.conf -P 5000 on the server without error message, I 
then start vtun on LinuxMint via /etc/init.d/vtun start.

The server is listening on the correct port and I can verify that two ways.  One is to issue a 
"netstat -tan | grep 5000" and the second is to connect from the client over that port via "ssh -l 
ID salad -L 5000:localhost:5000"  and this is successful for the associated ID user password.

However my "tun0" never appears when I start the client.   The message on the server (salad) states:
  Jul 28 16:01:45 salad vtund[5254]: Session ID[192.239.Y.Z:58680] opened
  Jul 28 16:01:45 salad vtund[5254]: Can't allocate tun device . No such file or directory(2)
  Jul 28 16:01:45 salad vtund[5254]: Session ID closed

I can immediately lsmod | grep tun and see the module:
[root@salad log]# lsmod | grep tun
tun                    44992  0
[root@salad log]# ls -l /dev/net/tun
crw------- 1 root root 10, 200 Dec  9  2008 /dev/net/tun

The pertinent lines from the vtund.server.conf are:
default {
         type tun;
         proto tcp;
         keepalive yes;
         compress no;
         encrypt no;   #ssh does encryption
         speed 0;      #ASAP
         stat yes;
}

options {
         port 5000;
         ifconfig /sbin/ifconfig;
         route    /sbin/route;
}

ID {
         encrypt no;
         password my_ID_passwd;
         persist yes;
         up {
                 ifconfig "%% 10.255.255.253 pointopoint 10.255.255.254 mtu 1450";
                 route "add -net 192.239.A.B netmask 255.255.255.0 gw 10.255.255.254 ";
         };


The pertinent lines from the vtund.client.conf are:
default {
         type tun;
         proto tcp;
         keepalive yes;
         compress no;
         encrypt no;   #ssh does encryption
         speed 0;      #ASAP
         stat yes;
}

options {
         port 5000;
         ifconfig /sbin/ifconfig;
         route    /sbin/route;
}

ID {
         encrypt yes;
         password my_ID_passwd;
         persist yes;
         up {
                 ifconfig "%% 10.255.255.254 pointopoint 10.255.255.253 mtu 1450";
                 route "add -net 192.239.A.B netmask 255.255.255.0 gw 10.255.255.253 ";
         };


My web searches on the error message "Can't locate tun device" all indicate cases in which modules 
for tun was not loaded.   I believe mine is-----unless the kernel module for tun is not the same as 
the /dev/net/tun????

Any suggestions are genuinely appreciated.

megan







More information about the Novalug mailing list