PDA

View Full Version : tun/tap on ubuntu



sesquipedality
January 22nd, 2005, 02:08 AM
Does the standard ubuntu kernel have support for the tun/tap device driver? If not, how does one go about adding support for it (i.e. compiling a compatible module or whatever else is required)? Thanks.

trapik
January 26th, 2005, 05:22 PM
yes /sbin/modprobe tun

sesquipedality
January 30th, 2005, 06:32 PM
Thank you. I really didn't expect it to be that simple.

Happy
April 4th, 2005, 09:42 AM
I've just spent the last several hours trying to get tun to work...
it just doesn't like me.
I've added the 'tun' module using modprobe and that's about it
whenever I try 'ifconfig tun0 10.0.0.1 up' or similar I get this result:
SIOCSIFADDR: No such device
tun0: ERROR while getting interface flags: No such device
tun0: ERROR while getting interface flags: No such device

I've created the /dev/net/tun node and checked it's privileges and all that jazz but still no love!
ifconfig -a comes up empty for the tun0 interface...
any ideas?
(i've installed the vtun package via synaptic was that the correct one?)

suoko
January 10th, 2006, 10:19 PM
I have the same problem using kernel 2.6.12-10-686 but I don't have any problems with latest dapper kernel.
Question: is it a problem related to the kernel?

dradul
January 10th, 2006, 11:51 PM
I've just spent the last several hours trying to get tun to work...
it just doesn't like me.
I've added the 'tun' module using modprobe and that's about it
whenever I try 'ifconfig tun0 10.0.0.1 up' or similar I get this result:
SIOCSIFADDR: No such device
tun0: ERROR while getting interface flags: No such device
tun0: ERROR while getting interface flags: No such device

I've created the /dev/net/tun node and checked it's privileges and all that jazz but still no love!
ifconfig -a comes up empty for the tun0 interface...
any ideas?
(i've installed the vtun package via synaptic was that the correct one?)
Have you created a virtual interface bridge? You need the userspace utilities contained in the vtun package (that's in the Universe repository).

cylon359
January 11th, 2006, 12:44 AM
You can also create a persistent tunnel with openvpn...

sudo openvpn --mktun --dev tun0

dradul
January 11th, 2006, 01:05 AM
There is also a tunctl utility in User Mode Linux (that hasn't worked for me, YMMV). You can download the source code from the project's CVS repository: http://www.user-mode-linux.org/cvs/tools/tunctl/tunctl.c?sortby=date.

dradul
January 13th, 2006, 05:59 PM
There is also a tunctl utility in User Mode Linux (that hasn't worked for me, YMMV). You can download the source code from the project's CVS repository: http://www.user-mode-linux.org/cvs/tools/tunctl/tunctl.c?sortby=date.
I can now say I have successfully used tunctl to set up a PPPoE (RFC2516) connection using the eciadsl (http://eciadsl.flashtux.org/) drivers (big change in my ISPs a day after I posted the above).

Now I'm using a PPPoE connection emulated over a persistent virtual ethernet TAP created with tunctl and controled with the eciadsl drivers. I tried with openvn at first but I then realized that it made the TAP device dependent on the openvpn daemon. Using tunctl is easier. You can either install uml-utilities available in the universe repository, or compile tunctl.c[1] and type a simple command[2].

[1] gcc -O2 -s -o tunctl tunctl.c

[2] sudo ./tunctl -u root tap0

Fink
December 20th, 2007, 07:36 PM
Thank you. I really didn't expect it to be that simple.

didn't know that either

dramaekrs
November 9th, 2011, 09:37 PM
Hi,

I see there are people here who know what they are talking about :)

I had a working vpn server in tun/tap. After doing a dist-upgrade to 11.10, I still can connect to the vpn server but the network behind the vpn server isn't forwarded any more.

Say the IP of my vpn-server is 10.3.0.50, on the remote client I can ping 10.3.0.50. But I can't ping 10.3.0.1...

Does any one have an idea where to look to solve this problem?

Dominique.