TUN/TAP drivers for OpenVPN on Linux

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
mholl
OpenVpn Newbie
Posts: 12
Joined: Mon Jan 28, 2013 4:53 pm

TUN/TAP drivers for OpenVPN on Linux

Post by mholl » Tue Apr 16, 2013 9:22 pm

I am trying to use OpenVPN on several versions of Linux but I am currently using Ubuntu 12.04 and Amazon AMI Linux. I installed openvpn on both machines and try to send a message between the two. The first step is to create the Tun/tap driver to start the connection and in Windows, I would use the tapinstall executable file to do this. I am trying to find a way how to do it for Linux but unfortunately, I am unable to find anything so far. Can anyone provide any insight on how to create a Tap/Tun driver in a Linux environment?

Thanks,
Mike

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: TUN/TAP drivers for OpenVPN on Linux

Post by janjust » Wed Apr 17, 2013 8:23 am

On Linux , the tun/tap drivers are part of the kernel itself and you don't need to install anything.

mholl
OpenVpn Newbie
Posts: 12
Joined: Mon Jan 28, 2013 4:53 pm

Re: TUN/TAP drivers for OpenVPN on Linux

Post by mholl » Wed Apr 17, 2013 12:51 pm

Ok so I just use the OpenVPN command to connect to a remote user and select the number for the driver? (for example tun0, tun1, etc)

Also in Windows, there is a show valid subnets command. Is there something equivalent in Linux?

Thanks,
Michael

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: TUN/TAP drivers for OpenVPN on Linux

Post by janjust » Wed Apr 17, 2013 1:37 pm

just use

Code: Select all

dev tun
and the OS will pick one for you; if you want to overrule this, specify an explicit number, e.g.

Code: Select all

dev tun0
but in that case it's "whoever comes first, wins" : the second openvpn instance to start will fail because "tun0" has been assigned already.

the '--show-valid-subnets' command also works on Linux.

mholl
OpenVpn Newbie
Posts: 12
Joined: Mon Jan 28, 2013 4:53 pm

Re: TUN/TAP drivers for OpenVPN on Linux

Post by mholl » Wed Apr 17, 2013 2:53 pm

Thanks for that.

I tried to use the openvpn command but i get the following message below.
"Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
/sbin/ip link set dev up mtu 1500
Linux ip link set failed: external program exited with error status: 255"

In addition,

I used the show valid subnets command, like this: openvpn --show-valid-subnets and the error states "Unrecognized options or missing parameters in CMD-LINE: 1. Then I try openvpn show-valid-subnets and the error states: "Error opening configuration file: show-valid-subnets"

Do you have any insight on what this means?

Thanks
Michael

mholl
OpenVpn Newbie
Posts: 12
Joined: Mon Jan 28, 2013 4:53 pm

Re: TUN/TAP drivers for OpenVPN on Linux

Post by mholl » Wed Apr 17, 2013 3:38 pm

Ok I figured out the first problem. My good friend sudo came to the rescue.

I am still having issues receiving the subnets from the command.

Thanks
Michael

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: TUN/TAP drivers for OpenVPN on Linux

Post by janjust » Thu Apr 18, 2013 8:00 am

oh my bad: I thought the command was also included in the Linux version; it's pretty much a bogus command anyways :)

For your server subnet, choose something like "server 10.8.0.0 255.255.255.0" (this is the often-used default). It should be fine for most uses.

mholl
OpenVpn Newbie
Posts: 12
Joined: Mon Jan 28, 2013 4:53 pm

Re: TUN/TAP drivers for OpenVPN on Linux

Post by mholl » Fri Apr 19, 2013 2:07 pm

Ok I will try that.

Thanks,
Michael

Post Reply