1

I wondered, if the following scenario is possible:

If I create a new tunnel adapter on startup of my ubuntu server 14.04, can I tell an OpenVPN client to use this tunnel instead of creating a new tunnel for itself?

The thought behind this is that I could allow a normal user to create an OpenVPN connection through said client without giving root privileges needed to create the tunnel.

1 Answer 1

1

From the OpenVPN manual page:

--dev tunX | tapX | null

TUN/TAP virtual network device ( X can be omitted for a dynamic device.)


Create a persistent tunnel device with:

sudo openvpn --mktun --dev <tun-name> --user <user-name> --group <group-name>

<tun-name> will be the tunnel device name. It should be "tun+number" (tun0, tun1, etc.).

<user-name> and <group-name> refer to user that will own the tunnel device.

Then you should use the same tunnel device name in the OpenVPN client. Instead of using --dev tun (command line parameter) or dev tun (configuration file), you should specify the name of the persistent tunnel device you created: --dev <tun-name> (command line parameter) or dev <tun-name> (configuration file).

3
  • When I try to use --dev RemoteBackupTunnel it will just respond with "I don't recognize RemoteBackupTunnel as a tun or tap service". Same with other names except tun (+ a number). --dev tun10 for instance works fine. Mar 9, 2016 at 7:36
  • @FlorianSplett Indeed. It's weird, because I could swear I have used other names a long time ago. Or maybe it's my memory that's failing. Answer fixed. Mar 10, 2016 at 13:40
  • Use dev-type tun in this case.
    – i336_
    Aug 18, 2016 at 5:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .